Skip to content

Does not warn about non-nullable class-property #14393

@MacGritsch

Description

@MacGritsch

Bug report

I think phpstan could warn that the null-coalescing-operator makes no sense in this code.

Code snippet that reproduces the problem

https://phpstan.org/r/12d977e4-7125-4507-a31b-cc92dca2353f

Expected output

Property MyClass::$i (int) on left side of ?? is not nullable.

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