Skip to content

Remove/change scope of readonly properties vs DependencySerializationTrait warning #889

@mxr576

Description

@mxr576

Bug report

Slightly related to the conversation in phpstan/phpstan#6562.

PHPstan Drupal currently warns about readonly properties are not supported by DependencySerializationTrait, but that is not necessarily true. Using those does not cause any fatal errors as long as properties only initiated once, like in Entity type defs, Entity access control handlers, etc.

The this rule (clause) was introduced in #731 PR and there was a dedicated thread about whether the readonly warning is universally true.

Code snippet that reproduces the problem

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions