Problem/Motivation
The phpstan job went red after the June 2026 pipelines without any related code change: a newer phpstan-drupal added rules for DependencySerializationTrait, entity storage injection and loggers, and reports 46 errors. 36 of them are one pattern: constructor-promoted private readonly properties in FilterForm, PickGoForm and five blocks that use the serialization trait. Those are a real risk, not just style: private properties are dropped and readonly ones cannot be restored when a form or block gets serialized into the form cache. The rest are the ExportForm injecting two entity storages, the profile block taking its logger from the factory, the migrate test base storing an entity storage, and the deprecated user_load_by_name().
Steps to reproduce
Proposed resolution
- Make the promoted properties
protected(no readonly) in the two forms and five blocks. - ExportForm: inject the entity type manager and get the storages at the call sites.
- UserProfileBlock: inject the named
logger.channel.l10n_communitychannel (new service), autowired. - MigrateL10nTestBase: get the storage from the entity type manager when needed instead of storing it.
- ImportForm: load the import user through entity storage instead of
user_load_by_name(). - Keep only the three list builders in the baseline: they follow core's EntityListBuilder constructor, which is the pattern the rule complains about.
Also fixes the cspell job at the source: the Drupal 7 test method name typo (testSuggetions) is renamed on both branches and the Hungarian test strings are English now.
Remaining tasks
User interface changes
API changes
Data model changes
LLM disclosure
LLM was used to find, diagnose explain and fix this issue. With human review.
Comments
Comment #10
gábor hojtsy