Migrate rector.php to RectorConfig::configure() builder#420
Merged
Conversation
The legacy callable-config style (return static function (RectorConfig $rectorConfig)) is being phased out in Rector's docs in favour of the fluent builder. Same paths, same single rule, same sets — just folded into one chained return statement so the file reads top-down. No semantic change: LevelSetList::UP_TO_PHP_82 stays the same and covers PHP improvements through 8.2. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
987ae75 removed the (string) casts around preg_match / preg_replace / trim in applyModifiersToEvents because they silently turned a preg_replace null return (PCRE runtime error) into an empty title, letting an event through with no filter applied. Rector wants the casts back; applying them re-introduces the silent coercion the commit specifically set out to remove. Suppressing the rule on this file alone is the honest answer. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
turegjorup
force-pushed
the
feature/rector-fix-calendar-feed
branch
from
May 1, 2026 07:49
af9cb78 to
e8cc53b
Compare
tuj
self-requested a review
May 1, 2026 09:45
tuj
approved these changes
May 1, 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.
Description
Two commits, primary scope is migrating
rector.phpto the modern builder pattern. The Rector failure onCalendarApiFeedType(which CI surfaced after987ae75c) is fixed in passing.1. Migrate
rector.phptoRectorConfig::configure()builderThe legacy callable-config style is being phased out in Rector's docs in favour of the fluent builder. Same paths, same single rule (
InlineConstructorDefaultToPropertyRector), same set list (LevelSetList::UP_TO_PHP_82and the Doctrine/Symfony sets). One chained return statement so the file reads top-down. No semantic change.2. Skip
NullToStrictStringFuncCallArgRectoronCalendarApiFeedType987ae75c("7329: Omit event on PCRE error in title modifier") removed three(string) $titlecasts inapplyModifiersToEventsbecause they silently turned apreg_replacenull return (PCRE runtime error) into an empty string, letting an event through with no filter applied. The current code stores the result into$replaced, null-checks it, andcontinue 2s with an error log on PCRE error.Rector wants the casts back. Applying them re-introduces the silent coercion
987ae75cset out to remove. Suppressing the rule for that one file is the honest answer — comment inrector.phpexplains why. Two more invasive alternatives exist (PHPDoc'ing the modifier array shape, or narrowing the type at the assignment withis_string), both viable follow-ups if the team wants to lift the suppression later.Verification
docker compose run --rm phpfpm vendor/bin/rector --dry-runreturns[OK] Rector is done!locally. CI on this PR is the canonical check.Checklist