From 19d58f3bb85396f0c5aa46bfc6c0ed1c8ed4f0b3 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Sun, 10 Nov 2024 19:43:59 +0100 Subject: [PATCH] [TASK] Add more Rector rules --- config/rector.php | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/config/rector.php b/config/rector.php index 978e0064..4141a011 100644 --- a/config/rector.php +++ b/config/rector.php @@ -3,6 +3,10 @@ declare(strict_types=1); use Rector\Config\RectorConfig; +use Rector\PHPUnit\Set\PHPUnitSetList; +use Rector\Set\ValueObject\LevelSetList; +use Rector\Set\ValueObject\SetList; +use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector; return RectorConfig::configure() ->withPaths( @@ -11,9 +15,27 @@ __DIR__ . '/../tests', ] ) - ->withPhpSets() - ->withRules( - [ - // AddVoidReturnTypeWhereNoReturnRector::class, - ] - ); + ->withSets([ + // Rector sets + + LevelSetList::UP_TO_PHP_73, + + // SetList::CODE_QUALITY, + // SetList::CODING_STYLE, + // SetList::DEAD_CODE, + // SetList::EARLY_RETURN, + // SetList::INSTANCEOF, + // SetList::NAMING, + // SetList::PRIVATIZATION, + SetList::STRICT_BOOLEANS, + SetList::TYPE_DECLARATION, + + // PHPUnit sets + + PHPUnitSetList::PHPUNIT_80, + // PHPUnitSetList::PHPUNIT_CODE_QUALITY, + ]) + ->withRules([ + AddVoidReturnTypeWhereNoReturnRector::class, + ]) + ->withImportNames(true, true, false);