Skip to content

readonly props seem to be not fully supported via traits #7271

@herndlm

Description

@herndlm

Bug report

When using readonly props in traits, some rules seem to be not working. In particular, the MissingReadOnlyPropertyAssign rule seems to be not creating errors I'd expect it to.

Code snippet that reproduces the problem

https://phpstan.org/r/ae4cf6c0-b690-4d0e-9b59-5d246ca8a85c

Expected output

Throw also errors for invalid assignments of the bar and baz properties.

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

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