Skip to content

Reduce PHPStan baseline and fix type debt #1811

Description

@superdav42

What

Reduce and eventually remove the 521-finding PHPStan baseline introduced by #1805 while preserving add-on compatibility rules for public APIs.

Why

The baseline restores a regression gate but represents substantial type debt. Fixing the findings will improve defect detection and make future PHPStan upgrades safer.

Tier

tier:standard — findings span many production components and require semantic type decisions, but the gate and rollback are established.

Files

  • phpstan-baseline.neon
  • phpstan.neon.dist
  • Production files named by baseline entries under inc/, views/, and ultimate-multisite.php

Reference pattern

Run pnpm run stan, fix underlying code or accurate PHPDoc, and remove only the matching count-specific baseline entry. Do not add public return declarations to extensible base classes, interfaces, gateways, integrations, UI base elements, models, or checkout APIs.

Implementation steps

  1. Group findings by identifier and prioritize real undefined-variable, argument, and return-contract defects.
  2. Apply small coherent fixes with focused regression tests where behavior is uncertain.
  3. Regenerate or hand-reduce the baseline only after each fixed group.
  4. Keep broad ignore rules and analysis level unchanged unless separately justified.

Acceptance criteria

  • Baseline finding count decreases materially.
  • No new broad ignore rule is introduced.
  • pnpm run stan passes.
  • Relevant focused PHPUnit tests pass.
  • Public extension compatibility constraints remain intact.

Verification

  • pnpm run stan
  • pnpm run quality
  • Focused PHPUnit classes for changed production code

Dependency

Blocked by #1805; begin after PR #1806 merges.


aidevops.sh v3.32.317 plugin for OpenCode v1.18.29 with gpt-5.6-sol spent 4h 26m and 539,830 tokens on this with the user in an interactive session.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    auto-dispatchblocked-by:GH#1805Blocked until GH#1805 is completedorigin:interactiveCreated by interactive user sessionpriority:mediumMedium severity — moderate quality issuequality-debtUnactioned review feedback from merged PRsstatus:blockedWaiting on blocker tasktier:standardAuto-created by pulse labelless backfill (t2112)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions