Skip to content

chore(ci): pin rector 2.7.0 and apply its rewrites - #18

Merged
abdul-kaioum merged 1 commit into
mainfrom
chore/rector-2.7
Oct 26, 2026
Merged

abdul-kaioum merged 1 commit into
mainfrom
chore/rector-2.7

Conversation

@abdul-kaioum

Copy link
Copy Markdown
Member

Why

CI on main has failed since 2026-09-05, before tests even run. composer.lock isn't committed, so every run resolves rector/rector: ^2.5 to the newest release. Rector 2.7.0 flags existing code, so composer rector (--dry-run) exits 2. The same failure blocks #17.

What

  • Pin rector/rector to 2.7.0 so a new Rector release can't turn CI red again.
  • Apply its rewrites:
    • ??= replaces the isset/is_null-then-assign lazy singletons in CacheManager, Hooks, Response, RouteBase, Router and Shortcode. These are equivalent.
    • : bool return 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 declared null default 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

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
@abdul-kaioum
abdul-kaioum merged commit 6327863 into main Oct 26, 2026
6 checks passed
@abdul-kaioum
abdul-kaioum deleted the chore/rector-2.7 branch October 26, 2026 09:17
abdul-kaioum added a commit that referenced this pull request Oct 28, 2026
InteractsWithHeaders landed (#19) after the rector 2.7 bump (#18), so
the CI rector dry-run has failed on main since. The types are safe to
add: the trait is unreleased, so no consumer overrides exist yet.

Assisted-By: AI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants