On Sat Dec 11 10:25 AM, Stefan Marr wrote:
>
http://wiki.php.net/rfc/horizontalreuse#requiring_composing_class_to_impleme
nt_interface
> 
> 
> Are there any objections to implementing this?
> 

It's not a bad idea, though I haven't found a strong need for it in the way
I plan to use traits.

It also turns a trait into something more complex 'copy & paste' code with
requirements/dependencies.

-1 on using 'require' (T_REQUIRE token), an option could be 'within'

trait IteratorUser within Iterator {
    function foo() {
        $next = $this->next();
        ...
    }
}

class MyIterator implements Iterator {
  with IteratorUser;
} 

So the 'with/within' tokens would apply to traits.

Overall I feel -1, more use cases around "Trait expresses a requirement for
the composing class" would help, it seems like useful theory...  not
convinced it's worth the trouble.




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

Reply via email to