Skip to content

Attribute name case sensitivity not checked when present in use statement #12827

Description

@janedbal

Bug report

See snippet, AST node itself has the fixed case. I believe this is done by PhpParser\NodeVisitor\NameResolver and you should check originalName attribute to see the real case used:

Image

When no use statement is used, it works: https://phpstan.org/r/0e21633f-6c52-442d-9e83-a1a3516f9d16

Code snippet that reproduces the problem

https://phpstan.org/r/334fc9ec-9605-48e7-9d6d-43337f419d5f

Expected output

Class Foo\Post referenced with incorrect case: Foo\POST.

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

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions