Problem/Motivation

#3611317 fixed PHPStan for the current major, but the phpstan (previous major) job (Drupal 10) still fails:

  • EntityListBuilder::getDefaultOperations() invoked with 2 parameters, 1 required in OrderListBuilder, ProductListBuilder, ProductVariationListBuilder, CouponListBuilder, PromotionListBuilder and StoreListBuilder. The CacheableMetadata argument only exists since Drupal 11.3, and the existing ignore only covered ConfigEntityListBuilder in NumberPatternListBuilder.
  • Drupal\Core\DefaultContent\Exporter and Drupal\Core\DefaultContent\PreExportEvent not found (DefaultContentEventSubscriber, ProductVariationExportTest).
  • Drupal\Core\Field\FieldPurger not found in UninstallTest, and the inline @phpstan-ignore function.deprecated is reported as unmatched, since field_purge_batch() isn't deprecated on Drupal 10.

Proposed resolution

Add phpstan.neon ignores with reportUnmatched: false so both the current and previous major pass:

  • Make the getDefaultOperations() ignore cover both EntityListBuilder and ConfigEntityListBuilder, without restricting the path.
  • Ignore the DefaultContent classes in the two affected files.
  • Move the UninstallTest ignore from the inline comment to phpstan.neon.

Issue fork commerce-3635820

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

jsacksick created an issue. See original summary.

  • jsacksick committed 98964d95 on 3.x
    ci: #3635820 Fix PHPStan errors on the previous major
    
jsacksick’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.