Skip to content

False positive staticMethod.impossibleType #13566

@integer

Description

@integer

Bug report

Maybe some issue with conditional return type, see example.

Code snippet that reproduces the problem

https://phpstan.org/r/01473861-abe1-4e99-acb6-424458d0a2d7

Expected output

In linked example i have expected no error, but Call to static method HelloWorld::notFound() with false will always evaluate to false. is reported.

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

Yes, helps me detect dead code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions