Re: [RFC] Traits with interfaces

From: Date: Wed, 17 Feb 2016 15:48:35 +0000
Subject: Re: [RFC] Traits with interfaces
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-91251@lists.php.net to get a copy of this message
Hi Kevin,   Hi all, On Mi, 2016-02-17 at 09:25 -0500, Kevin Gessner wrote: >  > I've noticed s pattern in Etsy's code and elsewhere, where a trait > provides a common implementation of an interface.  Classes that use > the trait are required to also explicitly declare the interface to > benefit.  I propose that traits be permitted to declare and implement > interfaces.  Classes that use such a trait would then implement the > interface, as though it were declared on the class, without declaring > the interface explicitly. While I do see the benefit in that behavior and I admit I sometimes in the past wished for something like that as well, it's quite implicit as one cannot see that class "implements" the interface. Which makes it already less appealing to me. Additionally, I wonder what the expected behavior would be when it comes to aliasing, visibility changing and conflict resolving? Kind regards, Arne Blankerts -- Those who do not understand Unix are condemned to reinvent it, poorly (Henry Spencer,1987)

Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc
« previous php.internals (#91251) next »