Repository navigation
chore: enforce the code style and Rector gates - #29
Merged
Merged
Conversation
added 3 commits
November 17, 2026 17:09
… after the opening tag)
…ructor promotion) and the Pint preset; mark the query classes as having a consistent constructor
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.
Turns two of the three observed gates of this repository into blocking ones: Code style and Rector. Static analysis stays observed, with the reason below.
Code style. The harness Pint preset (
vendor/pollora/harness/presets/pint.json) is stricter than the repository's own configuration, which is why the gate had been left observed. It fixed 41 files: 33 test files lackeddeclare(strict_types=1)(added: onlytests/changes here for that rule,src/already had it), and in 8 classes the order of the class elements and the separation of attributes now follow the preset.Rector. 22 files: typed class constants (
final public const string …, PHP 8.3), separateusestatements, first-class callables, one constructor promotion, a redundant union@returnremoved, andin_array(…, true)inTaxQueryBuilder::field()(the value and the allowed list are strings, so the result is the same).Static analysis (left observed): 26 errors, down from 38. The 12
new static()errors are fixed with@phpstan-consistent-constructoron the six query classes. The 26 left: 19 come from theSubQuerytrait reading properties of the class that uses it by a built name ($this->{$field}), which PHPStan cannot follow; 4 are array-shape docblocks ofDateQueryBuilder; 3 are others. Two of them point at something that may be a real typing slip, not fixed here: inTraits/Tag.php(lines 87 and 97)$tagSlug_Andis typedarray<string>|nullbut receivesarray<int>, and$tagSlug_Inis the other way round. Making this gate blocking needs either a baseline (it would widen the ratchet from 0) or a rework of the trait; that is a separate decision.Checked. 429 tests pass;
pollora-qa check --mutationpasses every gate that is not observed, mutation score 95.56 % (floor 93) and line coverage 97.66 % (floor 97.12), both "improved". Pint with the harness preset and Rector--dry-runare clean. The public API surface check (QA-04/QA-05) runs in this pull request's CI: typed constants are the only change that could touch it.