Repository navigation
test: restore the mutation score lost with the PHPStan level raise - #64
Merged
Merged
Conversation
added 2 commits
November 26, 2026 14:33
File::directories() only lists strings, and the type filter of discovered_components is already validated before it is mapped. The last branch of formatRecurrence() becomes a guard that throws, then Value::text(), so a test can observe it. No behaviour change.
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:
test/restore-mutation-score, based onmain(7a12cb4).mainis red since #63: mutation score 93.36 % (43 untested of 648) for a recorded floor of 95. Comparing the survivors with 27f847e (95.82 %, 25 untested) shows 18 new ones, all in the code added for PHPStan:Support\Value, the guards ofPolloraStatus,DiscoveredComponentsandActiveThemeInfo.Tests: what the tools do with a recurrence declared as an int-backed enum, a pure enum or a
Stringable; acomposer.lockwithout a package list or with incomplete entries; modules without the expected methods;Support\Valueitself. A few cases on thewp_optionsecret guard (spaces around a name, non-text allow-list entries) kill older survivors.Code, no behaviour change and no public change:
ActiveThemeInfo: theis_stringfilter overFile::directories()could never remove anything; replaced by alist<string>annotation.DiscoveredComponents: the type filter was checked twice; it is now mapped where it is validated.DiscoveredComponents::formatRecurrence: the last branch is written as a guard that throws, thenValue::text(), so the guard is observable by a test..harness.jsonis untouched.Mutation score: 93.36 % -> 96.73 % (21 untested of 642).
Proved
vendor/bin/pollora-qa check --mutation --coveragepasses (PHP 8.4, macOS): 96.73 %, ratchet included.late_afterline).composer qa:fastandcomposer qapass; PHPStan clean at level 10.Not proved
late_afterand on the age of failures, which need a controllable clock) are not addressed.