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

Closed
mattschlosser opened this issue Nov 10, 2022 · 3 comments
Closed
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

@ondrejmirtes
Copy link
Member

Fixed: phpstan/phpstan-src#2484

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants