Skip to content

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

@RuggMatt

Description

@RuggMatt

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions