Skip to content

Readonly property can be not set in if-else condition, and PHPStan yields no error #7649

@fluffycondor

Description

@fluffycondor

Bug report

Readonly property can be not set in if-else condition, and PHPStan yields no error.

Code snippet that reproduces the problem

https://phpstan.org/r/9d088cab-7c46-4d83-a75b-739900979c5b

Expected output

This snippet should yield a "Readonly property not set in the constructor" issue.

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