Repository navigation
chore(qa): raise PHPStan to level 7 - #56
Merged
Merged
Conversation
added 8 commits
November 25, 2026 12:17
… keyed by name (PHPStan level 7)
…he table name is interpolated (PHPStan level 7)
…ad functions through a closure (PHPStan level 7)
…cks without assuming their shape (PHPStan level 7)
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-7, stacked onchore/phpstan-level-6. It carries the two bug fixes below as cherry-picked commits (b9f5bd1,a5b94be): merge their PRs first, or this one carries them.What changed
about 45 errors (19 in
src/, 26 intests/):lot5-hook-fix-invokable.md(invokable objects /Class::methodstrings in argument detection:TypeError),lot5-hook-fix-nonpublic.md(a non-public handler method was retriedtriestimes).$wpdbinRecovery::recover()/UniqueLock::prune(): declared\wpdb|null(@varon theglobal, which has no declared type; the runtimeis_object()guard is kept so the test doubles still work).wpdb::prepare()wants a literal string and the query interpolates{$wpdb->options}, the table name, which no placeholder can replace before WordPress 6.2's%i: two@phpstan-ignore argument.type (reason), reason on the line. Every value goes through a placeholder.array<string, mixed>/array<int, mixed>toarray<int|string, mixed>(AsyncPayload,AsyncContext,AsyncDispatcher): the code never enforced string keys, and the variadicQueuedHandler::__invoke(mixed ...$arguments)carries named arguments through. Doc only.AbstractHook::replaceTrackedCallback()updates a local copy of the registrations then assigns it (same result); function names are read throughReflectionFunction(Closure::fromCallable(...));resolveClassMethodCallback()takes aclass-string.json_encode(..., JSON_THROW_ON_ERROR)(thestring|falsethe tests passed on), and a few reads that assumed the shape of a registration.Checked
0 errors at level 7;
pest555 pass + 1 incomplete;composer qapasses (line coverage 95.9 %, recorded 93.05).Not verified
Semgrep not run (SEC-03 on the two
$wpdbqueries, unchanged text, not re-scanned); mutation not measured; WordPress suite not run.