On 6 January 2022 17:36:41 GMT, "Alexandru Pătrănescu" <dreal...@gmail.com> 
wrote:
>Yes, traits are a language construct that has in general more negative
>implications than positive so it's good to keep an eye on their usage.
>One of the okish usages is to define some implementation for an interface
>that classes can use.
>Limiting that trait to be used only by classes implementing the interface
>is seen as a restriction placed on the trait that would not allow it to be
>used in other places when it might have a negative impact.


The examples I've generally seen of problematic trait use are more about what's 
in the trait itself, rather than where it's used. I can't really picture what 
would be the "negative impact" of using somebody else's well-designed trait 
(and if it's not well designed, it presumably wouldn't make use of the new 
syntax). Can you give any example scenarios that you think mandating an 
interface would help avoid?

Regards,

-- 
Rowan Tommins
[IMSoP]

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

Reply via email to