Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not report constructor unused parameter if class is an Attribute class #3776

Open
wants to merge 1 commit into
base: 2.1.x
Choose a base branch
from

Conversation

carlos-granados
Copy link

When defining Attribute classes usually the constructor parameters are not used, as the values are retrieved using reflection.

This PR modifies the UnusedConstructorParametersRule class so that unused constructor parameters are not reported if the class is an Attribute class.

Fixes phpstan/phpstan#7165

@carlos-granados
Copy link
Author

There is a failing check but seems unrelated to the PR 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Constructor of class xxx has an unused parameter $xxx also efects at new PHP 8 Attribute
1 participant