Fix PHPStan: do not store entity storage as a class property

Replaces the two entity-storage class properties phpstan flags (drupal.entityStoragePropertyAssignment) with a call-site accessor.

  • DomainConfigUtilities: the constructor now promotes EntityTypeManagerInterface instead of assigning a storage handler, and a protected domainStorage() resolves the handler when it is needed. Autowired, so no services.yml change.
  • DomainSwitchControllerTest: same shape, which also removes a handler captured before the test rebuilds the container in setUp().

phpstan reports 0 errors for the project afterwards. phpcs (Drupal, DrupalPractice, warnings on) clean, kernel tests green (4 tests, 20 assertions).

A backport branch for 2.0.x is on the same issue fork (3613722-fix-phpstan-20x), where only DomainConfigUtilities is affected: that branch has no domain_sso_admin_toolbar kernel test.

Merge request reports

Loading