Skip to content

@readonly PHPDoc tag ignored for promoted property #7361

@ZebulanStanphill

Description

@ZebulanStanphill

Bug report

The @readonly PHPDoc tag is ignored when used on a promoted property in a class constructor.

Code snippet that reproduces the problem

https://phpstan.org/r/139ee2b1-9c8c-4ffa-84dc-980dfc1aa320

Expected output

The provided snippet ought to complain that Example#doStuff() modifies Example#foo.

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

It helped me catch several typos while doing a big refactor. I am very glad to discover these issues during development rather than runtime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions