diff --git a/CHANGELOG.md b/CHANGELOG.md index aceb78f5..5eedbdb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +- Migrated `rector.php` to the `RectorConfig::configure()` builder. - Gathered all repositories in one Symfony application. - Changed to vite 7 and rolldown. - Added ADRs 008 and 009. diff --git a/rector.php b/rector.php index 9773c23c..016c83c6 100644 --- a/rector.php +++ b/rector.php @@ -5,22 +5,21 @@ use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector; use Rector\Config\RectorConfig; use Rector\Doctrine\Set\DoctrineSetList; +use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector; use Rector\Set\ValueObject\LevelSetList; use Rector\Symfony\Set\SymfonySetList; -return static function (RectorConfig $rectorConfig): void { - $rectorConfig->paths([ +return RectorConfig::configure() + ->withPaths([ __DIR__.'/config', __DIR__.'/public', __DIR__.'/src', __DIR__.'/tests', - ]); - - // register a single rule - $rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class); - - // define sets of rules - $rectorConfig->sets([ + ]) + ->withRules([ + InlineConstructorDefaultToPropertyRector::class, + ]) + ->withSets([ LevelSetList::UP_TO_PHP_82, DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES, DoctrineSetList::DOCTRINE_DBAL_30, @@ -30,5 +29,13 @@ SymfonySetList::SYMFONY_63, SymfonySetList::SYMFONY_CODE_QUALITY, SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION, + ]) + // The (string) casts Rector wants here would re-introduce the silent + // null→"" coercion that 987ae75c removed: the title-modifier path is a + // correctness boundary, and on PCRE error the event is omitted with a + // log rather than passed through with an unfiltered title. + ->withSkip([ + NullToStrictStringFuncCallArgRector::class => [ + __DIR__.'/src/Feed/CalendarApiFeedType.php', + ], ]); -};