Skip to content

Remember narrowed types from the constructor when analysing other methods #12860

@staabm

Description

@staabm

Feature request

I think we could be smarter about narrowed types which are checked in a class constructor.

things like "if-global-constant is defined" should lead to PHPStan beeing aware of the global constant within the non-static class-method

no error in https://phpstan.org/r/07b1437d-7c6d-4f12-9a84-544a820bc50a

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

No response

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