dseguy, 5 months ago French #PHP Quizz : when is it useful to add the same trait t in a parent AND in a child class ? #phptip #phptrick
#PHP Quizz : when is it useful to add the same trait t in a parent AND in a child class ?
#phptip #phptrick
Crell, 5 months ago French @dseguy When the trait contains private methods.
@dseguy When the trait contains private methods.
cabbey, 5 months ago @Crell @dseguy yeah, this is why I’ve done it. If the trait deals with private things… methods or members.
@Crell @dseguy yeah, this is why I’ve done it. If the trait deals with private things… methods or members.
Deuchnord, 5 months ago French @dseguy when A overwrites some methods defined in the trait, and B needs the original implementation? (although it would be better that A selects the methods it really needs from T in this case, of course)
@dseguy when A overwrites some methods defined in the trait, and B needs the original implementation? (although it would be better that A selects the methods it really needs from T in this case, of course)
dseguy, 5 months ago French @Deuchnord That is definitely one. Class implementation has precedence, so T might be overwritten by A, but still needed by B. This is good! And I have a another use case.
@Deuchnord That is definitely one. Class implementation has precedence, so T might be overwritten by A, but still needed by B.
This is good! And I have a another use case.
Add comment