Replies: 2 comments
-
What you are describing sounds a lot like
|
Beta Was this translation helpful? Give feedback.
-
If the above is the case, this may be a duplicate of #1543 when I interpret it as adding support for |
Beta Was this translation helpful? Give feedback.
-
Feature request
Many frameworks provide ways of dynamically loading props & methods into a class at runtime (essentially a runtime trait).
E.g., Yii Behaviors: https://www.yiiframework.com/doc/guide/2.0/en/concept-behaviors
This becomes inherently difficult for any static tooling (eg IDEs, PHPStan) to know about these additional class members.
Normally this means you need to create stubs.
@mixin
isn't an option, as the classes we're referring to are libraries/Composer packages.My proposal is to support something like
@mixin-to \some\ns\SomeClass
that could be added to either classes or class members to add those members to the referenced entity.Beta Was this translation helpful? Give feedback.
All reactions