Skip to content

Typed property mistaken as nullable #12723

@bjdelange

Description

@bjdelange

Bug report

When a property is typed with a docblock, it is correctly seen as not nullable.
If it is typed in code, it is not.

Code snippet that reproduces the problem

https://phpstan.org/r/cdd95d0c-1d9e-42fd-8cec-0d080fdebb59

Expected output

I would expect to see the same error for all three classes.

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

It has been making me very happy for many years 👍

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