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

UnusedPrivateMethodRule has false positives for usages done with case mismatches #9492

Closed
stof opened this issue Jun 22, 2023 · 2 comments
Closed

Comments

@stof
Copy link
Contributor

stof commented Jun 22, 2023

Bug report

If a private method is called with a mismatching case, UnusedPrivateMethodRule will report it as unused, while this is wrong (given PHP treats method names as case insensitive).
Worse is that the case mismatch is only reported by strict rules, so a developer trusting phpstan might remove the method (and then be granted with a missing method error on next run)

Code snippet that reproduces the problem

https://phpstan.org/r/738ba792-52e6-4e0e-8ba7-491ebc238488

Expected output

No errors should be removed (unless strict rules are enabled of course) by making UnusedPrivateMethodRule do a case insensitive check.

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

No response

@ondrejmirtes
Copy link
Member

Duplicate of #8346

@ondrejmirtes ondrejmirtes marked this as a duplicate of #8346 Jun 23, 2023
@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 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants