Repository navigation
chore(ci): pin rector 2.7.0 and apply its rewrites - #18
Merged
Merged
Conversation
composer.lock is not committed, so CI resolved rector ^2.5 to the newest release on every run. Rector 2.7.0 flagged existing code and failed the dry-run step before tests ran; main has been red since 2026-09-05. Pin rector to an exact version so new releases can't break CI, and apply its rewrites (??= for lazy singletons, bool return types on two private predicates). SettingsRepository::get() keeps an explicit early return instead of the suggested `?->default() ?? $default`, which would have replaced a field's declared null default with the caller fallback; a test now locks that behaviour. Assisted-By: AI
csemazharul
approved these changes
Oct 26, 2026
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.
Why
CI on
mainhas failed since 2026-09-05, before tests even run.composer.lockisn't committed, so every run resolvesrector/rector: ^2.5to the newest release. Rector 2.7.0 flags existing code, socomposer rector(--dry-run) exits 2. The same failure blocks #17.What
rector/rectorto2.7.0so a new Rector release can't turn CI red again.??=replaces theisset/is_null-then-assign lazy singletons inCacheManager,Hooks,Response,RouteBase,RouterandShortcode. These are equivalent.: boolreturn types on two private predicates (ClientIpResolver::isIpInRange,AjaxRouter::isRouteMatched). Every path already returns a bool.SettingsRepository::get()keeps an explicit early return instead of Rector's$field?->default() ?? $default. That version would have replaced a field's declarednulldefault with the caller's fallback. A new test locks the behaviour.Verified
Clean clone with no lock file, matching CI:
composer validate,lint,compat,rector,test(263) and php-cs-fixer all pass.🤖 Generated with Claude Code