Hi Lars,

> What about abstract methods in traits? I think this could be handy to
> enforce the user class implement a data getter.
>
> trait Foo {
>    public function doSomething()
>    {
>        return str_replace("foo", "bar", $this->_getString());
>    }
>    abstract protected _getString();
> }
>
> class Consumer
> {
>    use Foo;
>    protected function _getString()
>    {
>         return "foo";
>    }
> }
>
> What do you think?
I am sorry :) This part has been missing in the RFC.
But is already implemented in the patch and supposed to work exactly
like you has described it.

Kind Regards
Stefan

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to