psalm / psalm-plugin-symfony

Psalm Plugin for Symfony
MIT License
228 stars 53 forks source link

Issues with usage detection even after container xml is provided #307

Closed pkly closed 1 year ago

pkly commented 1 year ago

Methods marked with #[Required] as well as class constructors and whole classes (Commands), some services and event subscribers are marked as unused with the findUnusedCode="true" setting for psalm.

Class constructors are not marked as used, along with anything using the #[Required] attribute, even though it works the same as @required.

I had to temporarily disable the unused code search, as this is causing hundreds of issues.

It should be possible to correctly determine usage from the plugin by looking at existing and known references and simply unmarking these issues as needed.

Using the newest version of plugin and psalm as of writing this, php8.2

seferov commented 1 year ago

@pkly thank you for the report.

The issue is fixed with v5.0.4. Feel free to reopen the issue if it is not resolved