From 27b6122175288b818f05d40edbf06cf9cb6b2d76 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Fri, 1 Mar 2024 00:30:42 +0700 Subject: [PATCH 1/2] [Rector] Use new RectorConfig::configure() --- rector.php | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/rector.php b/rector.php index 60913b1..cc7d8f8 100644 --- a/rector.php +++ b/rector.php @@ -4,22 +4,20 @@ use Rector\Config\RectorConfig; use Rector\PHPUnit\Set\PHPUnitSetList; -use Rector\Set\ValueObject\LevelSetList; -use Rector\Set\ValueObject\SetList; -return static function (RectorConfig $rectorConfig): void { - $rectorConfig->sets([ - LevelSetList::UP_TO_PHP_81, - SetList::CODE_QUALITY, - SetList::CODING_STYLE, - SetList::DEAD_CODE, - SetList::NAMING, - SetList::PRIVATIZATION, - SetList::TYPE_DECLARATION, +return RectorConfig::configure() + ->withPhpSets(php81: true) + ->withPreparedSets( + codeQuality: true, + codingStyle: true, + deadCode: true, + naming: true, + privatization: true, + typeDeclarations: true + ) + ->withSets([ PHPUnitSetList::PHPUNIT_100, - ]); - - $rectorConfig->parallel(); - $rectorConfig->paths([__DIR__ . '/src', __DIR__ . '/tests', __FILE__]); - $rectorConfig->importNames(); -}; + ]) + ->withParallel() + ->withPaths([__DIR__ . '/src', __DIR__ . '/tests', __FILE__]) + ->withImportNames(); From fa8d64249ffb1a1b075dc2593d25af1cc601d571 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Fri, 1 Mar 2024 00:31:26 +0700 Subject: [PATCH 2/2] include root files --- rector.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rector.php b/rector.php index cc7d8f8..b145f79 100644 --- a/rector.php +++ b/rector.php @@ -19,5 +19,6 @@ PHPUnitSetList::PHPUNIT_100, ]) ->withParallel() - ->withPaths([__DIR__ . '/src', __DIR__ . '/tests', __FILE__]) + ->withRootFiles() + ->withPaths([__DIR__ . '/src', __DIR__ . '/tests']) ->withImportNames();