Open ceesgeene opened 3 months ago
Unfortunately @mixin also forwards methods
What would be the consequence? That BodyItem
methods would appear as valid on the list?
Yes, so for example phpstan incorrectly assumes $node->get('body')->mainPropertyName()
is valid.
Ah, yeah. It'd be great for some kind of mixin that only supported certain magic methods
Feature request
Using
@mixin
it is possible to explain that instances of FieldItemListInterface forward the properties its items:This would allow for things like:
Unfortunately
@mixin
also forwards methods. Hopefully@mixin-properties
will be introduced, or@mixin
will auto-detect what is being forwarded:phpstan/phpstan #11259: Fine-grained mixin support