Would a fair solution to this be having the using class define whether to
inherit the implementations? Perhaps a new keyword akin to 'propagated', so
the code will read

Class Foo {
   Use propagated TraitName;
}

Only then will the implementations from that trait bubble through. If it
isn't declared then the implementations are not visible. This should keep
all backwards compatibility and keep code readable since now we can
immediately tell which traits being used do we want the implementations for
in the main class.
On 22 Feb 2016 20:19, "Kevin Gessner" <kgess...@etsy.com> wrote:

> On Thu, Feb 18, 2016 at 4:13 PM, Kevin Gessner <kgess...@etsy.com> wrote:
>
> > On Wed, Feb 17, 2016 at 2:05 PM, Kevin Gessner <kgess...@etsy.com>
> wrote:
> >
> >> I've created a proper RFC wiki page here with the draft:
> >> https://wiki.php.net/rfc/traits-with-interfaces
> >>
> >> It includes more detail and several example code snippets.  Thanks all
> >> for your feedback so far.
> >>
> >
> > I've just updated the RFC to v0.2, presenting two proposals to be voted
> > separately: one to allow traits to declare and implement interfaces, and
> a
> > second (dependent on the first) to propagate interface declarations from
> > traits to classes.
> >
>
> I've created a php-src pull request for Proposal 1 of the RFC, allowing
> traits to declare and implement interfaces:
> https://github.com/php/php-src/pull/1773
>
> Reviews and feedback welcome!
>
> I haven't yet started on an implementation for Proposal 2.
>
> Cheers
> -- Kevin
>

Reply via email to