psalm / psalm-plugin-laravel

A Psalm plugin for Laravel
MIT License
298 stars 69 forks source link

SuppressHandler doesn't work with 2 levels inheritance #340

Open palviggi-videoslots opened 1 year ago

palviggi-videoslots commented 1 year ago

I had a lot of Commands with common functionality. I moved the common features into an abstract class and made all my commands extend from it. Now I have lots of messages in the psalm out put about PropertyNotSetInConstructor [...]$laravel as well as $name, $input and $output.

Those are normally suppressed by the BY_PARENT_CLASS rules, but there's an order of execution problem: AfterClassLikeVisit can be called before populate, at which point we only have 1 level of parent classes available to compare.

I guess one option could be to change it into AfterCodebasePopulatedInterface, and analyze all available classes at that point, not sure how much change it would be