Issue #3616747: Remove reportUnmatchedIgnoredErrors from phpstan configuration

Removes reportUnmatchedIgnoredErrors: false from phpstan.neon, so PHPStan reports ignores that no longer match an error, and drops the ignores that had gone stale. The module carried 50 of them; 26 remain.

Removed as unmatched:

  • 24 @phpstan-ignore-next-line comments across domain, domain_access, domain_alias, domain_config, domain_config_ui and domain_source.
  • The classConstant.internalClass identifier on the confirmFields() calls in domain_access.install and domain_source.install; method.internalClass is still reported there and is kept.

Two ignores were reported on one Drupal version and not the other, which an inline ignore cannot express. Both are resolved in the code rather than in the configuration:

  • module_set_weight() is deprecated as of Drupal 11.5, so function.deprecated was reported on the next major version of Drupal but not on 11.4. The four calls now go through DeprecationHelper::backwardsCompatibleCall(), which makes them forward compatible and leaves PHPStan nothing to report on either version. The ModuleWeight service is addressed by its service id rather than ModuleWeight::class, because the class does not exist in 11.4 and a class constant would be reported as class.notFound there.
  • DomainSourcePathAliasTest fell back to the path_alias.whitelist service when path_alias.prefix_list was absent. That service was removed in Drupal 10, so on ^11.4 || ^12 the fallback is unreachable and the conditional is removed, which also retires a cspell:disable-next-line.

phpstan.neon therefore keeps only its existing Unsafe usage of new static entry.

Verified: phpstan, phpstan (next major), phpcs, cspell, eslint, stylelint and phpunit all pass. phpunit (next major) fails with the five cases that also fail on 4.x without this change.

AI-Generated: Yes (Claude Code was used to make this change and to run PHPStan and PHPCS over the result against Drupal 11.4. I reviewed the work myself before posting it.)

Edited by Frank Mably

Merge request reports

Loading