chore: raise PHPStan to level 6 with baseline (Phase 4)#95
Merged
Conversation
Raises phpstan.neon.dist level 5 -> 6 and regenerates phpstan-baseline.neon (746 grandfathered errors). The project already uses the baseline pattern, so this extends it: CI now enforces level 6 on all NEW and changed code immediately, while the existing debt is captured for incremental burn-down. The 746 baselined errors are overwhelmingly "no value type specified in iterable type array" (missing array<K,V> shapes) — each needs the data shape understood, so they're fixed per-package over time, not in one pass. composer stan green; rector --dry-run clean; cs clean. Baseline file is auto-generated (do not hand-edit) — regenerate with `vendor/bin/phpstan analyse --generate-baseline` after burning down entries.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the Phase 4 modernization (AGENT.md §7): raise PHPStan level 5 → 8 incrementally. This is step one — 5 → 6.
What
phpstan.neon.dist:level: 5→level: 6.phpstan-baseline.neon: regenerated — 746 errors grandfathered.The project already used the baseline pattern (master is level-5-clean via an existing baseline), so this extends it rather than introducing a new mechanism. CI now enforces level 6 on all new and changed code immediately, while the existing debt is captured for incremental burn-down.
Why a baseline (not fix-all-now)
The 746 errors are overwhelmingly
no value type specified in iterable type array—arraythat needsarray<K,V>annotations, each requiring the concrete data shape to be understood. That's a multi-session, per-package manual effort; fixing 746 in one PR would be unreviewable. The baseline locks in the level-6 gate today and lets the debt be paid down separately (tracked — see linked issue).Verification
composer stan: No errors (green at level 6)rector process --dry-run: cleanphp-cs-fixer --dry-run: cleanFollow-up
Burn-down of the 746 baselined entries (and the subsequent 6→7→8 raises) is tracked separately. The baseline is auto-generated — regenerate with
vendor/bin/phpstan analyse --generate-baselineafter removing entries; don't hand-edit.