Repository navigation
fix(types): make PHPStan blocking and fix the tag slug, date builder and sub-query types - #33
Merged
Merged
Conversation
added 2 commits
November 18, 2026 13:52
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.
Fixes the 26 errors PHPStan reports on this package (level 5, no baseline, no
ignoreErrors, no@phpstan-ignore) and removes Static analysis from theobservedgates of.harness.json: the gate now blocks.Errors and decisions
Tag.php: the slugs oftagSlugAnd()/tagSlugIn()and their properties were documented asarray<int>in one place andarray<string>in another; slugs are strings (the existing test sends['dev', 'qa']). Nowarray<string>everywhere.DateQueryBuilder(3-6).$after/$beforewere declaredstringbut every setter stores the arrayextractFromDate()returns; the return shapes ofextractDateDetails()andhandleDefault()listed string values and required keys that are int and optional.QueryBuilder(7-8). The by-reference parameter ofapplyRelation()was too narrow;SubQuery::get()was called but the abstraction did not declare it (the three subclasses implement it):abstract public function get(): array.Traits/Query/SubQuery.php(9-26). One cause repeated for the Comment, Post, Site, Term and User queries:$this->{$field}read a property that not every host class has. The dynamic access is gone:addSubQuery()becomesmergeSubQuery($type, $current, $callback): arrayand each trait assigns its own property.Behaviour. No change at run time (types and an internal refactoring; the existing Tag, Date, Meta and Tax tests cover it).
addSubQuery()wasprotected: a subclass outside this package that called it would have to follow; no usage in the other Pollora repositories (searched). Listed in the CHANGELOG.Checked (re-run by the maintainer, not only by the author): PHPStan 0 error and 0 baseline line; 429 tests on macOS, with 5 random seeds, and on Linux (
php:8.4-cli); Pint and Rector (--dry-run) clean;pollora-qa check: Static analysis passes without being observed, with the ratchet, Rector, style and architecture.