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_community channel (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

gábor hojtsy created an issue. See original summary.

  • 96b5d747 committed on 3.0.x
    fix #3621221: 3.0.x CI: fix the new phpstan findings instead of...

  • 650e2588 committed on 3.0.x
    fix #3621221: 3.0.x CI: fix the new phpstan findings instead of...

  • e47eb5f5 committed on 3.0.x
    fix #3621221: 3.0.x CI: fix the new phpstan findings instead of...

  • f0fea7b2 committed on 3.0.x
    fix #3621221: 3.0.x CI: fix the new phpstan findings instead of...

  • af28554d committed on 3.0.x
    fix #3621221: 3.0.x CI: fix the new phpstan findings instead of...

  • a2a46b65 committed on 3.0.x
    fix #3621221: 3.0.x CI: fix the new phpstan findings instead of...

  • 430e97e0 committed on 3.0.x
    fix #3621221: 3.0.x CI: fix the new phpstan findings instead of...

  • 1afbf0f1 committed on 7.x-1.x
    fix #3621221: 3.0.x CI: fix the new phpstan findings instead of...
gábor hojtsy’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.