phpstan-drupal icon indicating copy to clipboard operation
phpstan-drupal copied to clipboard

Remove/change scope of readonly properties vs DependencySerializationTrait warning

Open mxr576 opened this issue 5 months ago • 0 comments

Bug report

Slightly related to the conversation in https://github.com/phpstan/phpstan/issues/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

mxr576 avatar Jun 30 '25 07:06 mxr576