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
- Group findings by identifier and prioritize real undefined-variable, argument, and return-contract defects.
- Apply small coherent fixes with focused regression tests where behavior is uncertain.
- Regenerate or hand-reduce the baseline only after each fixed group.
- Keep broad ignore rules and analysis level unchanged unless separately justified.
Acceptance criteria
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.
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.neonphpstan.neon.distinc/,views/, andultimate-multisite.phpReference 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
Acceptance criteria
pnpm run stanpasses.Verification
pnpm run stanpnpm run qualityDependency
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.