From 20a7de680869c7525a45f1f63aaeed0fdc9b4b9f Mon Sep 17 00:00:00 2001 From: Patrick Hesselberg Date: Thu, 21 Mar 2024 01:43:35 +0100 Subject: [PATCH] Use new rector syntax --- rector.php | 41 ++++++++++++++++------------------------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/rector.php b/rector.php index 90513bbfe..039b62b36 100644 --- a/rector.php +++ b/rector.php @@ -2,35 +2,26 @@ declare(strict_types=1); -use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector; use Rector\Config\RectorConfig; -use Rector\Set\ValueObject\LevelSetList; -use Rector\Set\ValueObject\SetList; +use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector; -return static function (RectorConfig $rectorConfig): void { - $rectorConfig->paths([ +return RectorConfig::configure() + ->withPaths([ __DIR__.'/app', __DIR__.'/bootstrap/app.php', __DIR__.'/config', __DIR__.'/database', __DIR__.'/public', - ]); - - $rectorConfig->rules([ - InlineConstructorDefaultToPropertyRector::class, - ]); - - $rectorConfig->skip([ - Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector::class, - ]); - - $rectorConfig->sets([ - LevelSetList::UP_TO_PHP_83, - SetList::CODE_QUALITY, - SetList::DEAD_CODE, - SetList::EARLY_RETURN, - SetList::TYPE_DECLARATION, - SetList::PRIVATIZATION, - SetList::STRICT_BOOLEANS, - ]); -}; + ]) + ->withSkip([ + AddOverrideAttributeToOverriddenMethodsRector::class, + ]) + ->withPreparedSets( + deadCode: true, + codeQuality: true, + typeDeclarations: true, + privatization: true, + earlyReturn: true, + strictBooleans: true, + ) + ->withPhpSets();