Skip to content

Make @psalm-readonly-allow-private-mutation as alias of readonly #7774

@zonuexe

Description

@zonuexe

Feature request

In Psalm, @psalm-readonly-allow-private-mutation is shorthand for combining @readonly and @psalm-allow-private-mutation. Adding @psalm-readonly-allow-private-mutation to PHPStan as an alias for @readonly improves interoperability.

I liked Psalm's @psalm-allow-private-mutation so I looked into PHPStan's implementation to bring the same functionality into PHPStan, but found that ReadOnlyByPhpDocPropertyAssignRule implicitly behaves as a private mutation. So we don't need to add @phpstan-allow-private-mutation.

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

I've been working on a major refactoring for the last few days and I'm really grateful for PHPStan.

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