Skip to content

@phpstan-assert-if-(true|false) static $var is not working #11289

@gnutix

Description

@gnutix

Bug report

Hello there,

I've noticed that static is not properly dealt with when using phpstan-assert-if-true (and I'd guess -if-false too).

Code snippet that reproduces the problem

https://phpstan.org/r/e709ae8d-7f34-4bab-9fad-7aa304ac38dd
https://3v4l.org/OUAgd

Expected output

No errors, $other should be of type SomeConcreteClass after parent::equals($other).

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

Today's a crazy day, but hopefully next time I'll have something nicer to say than just: thank you! <3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions