Problem/Motivation

Some phpstan findings were fixed, but the @phpstan-ignore-next-line remains in the code. This excludes the code from analysis and makes phpstan less reliable

Steps to reproduce

See https://git.drupalcode.org/project/domain/-/blob/4.x/phpstan.neon?ref_ty...

Proposed resolution

Remove reportUnmatchedIgnoredErrors from phpstan configuration

Remaining tasks

  1. Write a merge request
  2. Review
  3. Commit

User interface changes

None

API changes

None

Data model changes

None

Issue fork domain-3616747

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

idebr created an issue. See original summary.

mably made their first commit to this issue’s fork.

idebr’s picture

The module_set_weight deprecation is preferably fixed with the Drupal\Component\Utility\DeprecationHelper so the code is forward compatible and phpstan has nothing to report, see https://www.drupal.org/node/3379306

DeprecationHelper::backwardsCompatibleCall(
      currentVersion: \Drupal::VERSION,
      deprecatedVersion: '11.5',
      currentCallable: fn () => \Drupal::service(ModuleWeight::class)->set('domain_access', 20),
      deprecatedCallable: fn () => module_set_weight('domain_access', 20),
    );
mably’s picture

Status: Active » Needs review

DeprecationHelper fixes the deprecation, but ModuleWeight::class is itself a compile-time reference to a class that doesn't exist on 11.4 — that produced 8 class.notFound.

idebr changed the visibility of the branch 3616747-remove-reportunmatchedignorederrors-from-namespaced to hidden.

idebr’s picture

Status: Needs review » Reviewed & tested by the community

I see, that is annoying. Big improvement as is

  • mably committed 2a3cdf8e on 4.x
    task: #3616747 Remove reportUnmatchedIgnoredErrors from phpstan...
mably’s picture

Status: Reviewed & tested by the community » Fixed

Thanks @idebr for the review! Merged.

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.

  • mably committed d38117ab on 3.x
    task: #3616747 Remove reportUnmatchedIgnoredErrors from phpstan...