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

Private methods called with alternative casing are reported as not used #8346

Open
mattschlosser opened this issue Nov 10, 2022 · 1 comment
Labels
Milestone

Comments

@mattschlosser
Copy link

Bug report

PHPStan incorrectly reports a method is not used if it was (accidentally) called with a variant casing.
This could be misleading in the case that someone just accidentally made a typo when calling the method elsewhere.
If the method is reported as not used, I would assume it is safe to delete. Yet if it has been called, just with an alternate casing, this would result in the broken code if the method is removed. The strict rules correctly finds this case; however, they are not included or enabled by default.

Code snippet that reproduces the problem

https://phpstan.org/r/e538901d-1ae0-4207-baa8-41916179b733
https://3v4l.org/DDqqJ

Expected output

The method is not technically unused.

Did PHPStan help you today? Did it make you happy in any way?

Amazing tool!

@staabm
Copy link
Contributor

staabm commented Nov 11, 2022

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

No branches or pull requests

3 participants