Repository navigation
refactor(types): analyse ArgumentHelper at PHPStan level max - #25
Merged
Merged
Conversation
added 6 commits
November 26, 2026 09:51
…ng unused PHPStan skips a trait that no analysed class uses, so nothing in src was analysed. The class the tests use moves to tests/Fixtures, which joins the analysed paths; the baseline is no longer included. The one real report, an unknown type in a @var, is fixed.
Value types of the arrays of ArgumentHelper, in PHPDoc only.
No code change needed.
No code change needed.
No code change needed.
No code change needed beyond the PHPDoc of level 6.
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-up, basemain. Six commits: the baseline entry, then one per level (6 to 10).The finding
The baseline entry said "Trait ArgumentHelper is used zero times and is not analysed".
srcholds only that trait, so PHPStan analysed nothing: level 5 (and 6 to 10) were green without reading a line.What changes
TestClass) moves, now typed, totests/Fixtures/TestClass.php; that directory joins the analysed paths, so the trait is analysed. The test file requires it; tests and assertions are unchanged.phpstan.neonno longer includesphpstan-baseline.neon(with it included, the now unmatched entry fails the run).src/ArgumentHelper.php: PHPDoc only.@var args(an unknown class) becomesarray<array-key, mixed>|null; array value types are added. No signature or behaviour change.vendor/bin/pollora-qa ratchet --update --metric=phpstan_level:N --metric=type_coverage:88.8(the second flag keeps the floor rounded down to one decimal; the tool would otherwise write 88.89).Left for a maintainer (protected file, QA-02)
The ratchet still counts the 1 entry of the file nothing includes any more:
Checked (PHP 8.4, macOS)
TestClass.composer qa:fastandcomposer qa: every gate that ran passed. Line coverage 100 %, mutation score 91.67 % (floor 85).roave-backward-compatibility-check --from=2.0.0, in a local clone): no backwards-incompatible change.pollora/entity(which uses the trait), with this file copied into its vendor: PHPStan level 8 onsrc0 errors, tests pass.Not verified
pollora/query(which also uses the trait) were not run.