Ultimate-Multisite / Ultimate-Multisite/ultimate-multisite

Reduce PHPStan baseline and fix type debt

Open
#1,811 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-dispatch blocked-by:GH#1805 origin:interactive priority:medium quality-debt status:blocked tier:standard
Dominant language
PHP
Stars
214
Forks
86
Avg merge
5h 29m
Merged PRs (30d)
60

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

After #1805 and PR #1806 are complete, run pnpm run stan and group findings from phpstan-baseline.neon by identifier, tracing entries into inc/, views/, and ultimate-multisite.php. Fix coherent type issues with focused PHPUnit coverage where needed, then remove only matching baseline entries; pnpm run stan, pnpm run quality, and relevant PHPUnit classes must pass without weakening compatibility rules.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, testing, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.