Skip to content

False positive in Property Class::$property is never read, only written-rule when using empty() #5971

@jaylinski

Description

@jaylinski

Bug report

Rule Property Class::$property is never read, only written reports a false-positive when the class-property is "read" with empty().

Code snippet that reproduces the problem

https://phpstan.org/r/89c4e6d0-5ef4-492b-95fb-f0b7ed51a8ca

Expected output

There is no error when a class-property is "read" via empty().

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

PHPStan v1 new rules are awesome. 👍

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions