Repository navigation
chore(qa): raise PHPStan to level 6 - #55
Merged
Merged
Conversation
added 4 commits
November 25, 2026 12:17
…c aliases (PHPStan level 6)
…ble values explicitly (PHPStan level 6)
…he level (the composer scripts hard-coded --level=5)
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.
Branch:
chore/phpstan-level-6(basemainat 22bc9be). Stack: 6 -> 7 -> 8.What changed
96 errors, all
missingType.iterableValue/ template resolution: 52 insrc/, 44 intests/(hook analyses its tests too).src/: PHPDoc aliases onHookInterface(HookCallback = callable|string|array<array-key, mixed>,HookRegistration), imported with@phpstan-import-type. The callback array is deliberatelyarray<array-key, mixed>: a first attempt witharray{object|string, string}was refused by PHPStan itself (count() === 2always true), becauseAbstractHookstores any array as-is for deferred resolution.$hooksisstring|list<string>. PHPDoc only: no signature changes on the public API (Action,Filter,HookInterface,AbstractHook).tests/: shapes on helpers, stubs and anonymous classes; 5 Pest template errors fixed by reading nullable values explicitly (callbacks('init') ?? [],$caught?->getPrevious()).phpstan.neon:universalObjectCratesClasses: PHPUnit\Framework\TestCasereplaces the ignore pattern for "undefined property PHPUnit\Framework\TestCase::$x". Same tolerance (Pest fixtures live in dynamic properties), but the properties aremixed, whichexpect()can resolve (the ignored error had made them an error type). A typo in a dynamic property is still not reported, as before.composer.json: thephpstanandphpstan:ciscripts hard-coded--level=5, so the level inphpstan.neonwas ignored bycomposer phpstan; removed,phpstan.neonowns the level (pollora-qareads it from there).Checked
0 errors at level 6, baseline 0;
pest552 pass + 1 incomplete (onmaintoo);composer qapasses.Not verified
Semgrep not run; mutation not measured; the WordPress suite (
composer test:wordpress) not run (needs a database).