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

Adjust linter to report unused namespace imports #4580

Open
ahaeslich opened this issue Oct 6, 2023 · 0 comments · May be fixed by #4949
Open

Adjust linter to report unused namespace imports #4580

ahaeslich opened this issue Oct 6, 2023 · 0 comments · May be fixed by #4949
Labels

Comments

@ahaeslich
Copy link
Member

There are quite a lot of unused use statements in our code base.

It would be helpful if composer lint would report these.

There should be a NoUsedImports feature in PHPCS, but I can't get it to work somehow

There is no such sniff in PHPCS according to squizlabs/PHP_CodeSniffer#801 but we could use the php-cs-fixer for that:

php-cs-fixer fix --rules no_unused_imports ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

1 participant