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