Skip to content

Context checking problem #5192

@holantomas

Description

@holantomas

Bug report

PHPStan 0.12.88 (0.12.90 too)

PHPStan doesn't check context/content of method used to check nullable property. So if you check property to NOT NULL and then call method on object inside of property, phpstan will throw error that you are trying to call method on Class|null.

Code snippet that reproduces the problem

https://phpstan.org/r/36c98b61-ad1c-45b6-9bcb-9030ea81384a

Expected output

https://phpstan.org/r/586cd694-4101-4643-9482-37e11bbee430

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions