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.
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!
The text was updated successfully, but these errors were encountered: