From 56fea1d94a554c687b827aec6a618cd317a909cb Mon Sep 17 00:00:00 2001 From: yaozm Date: Mon, 29 Jan 2024 14:47:31 +0800 Subject: [PATCH] refactor(config): update PHPUnit set and add new rule - Update PHPUnit set to use PHPUNIT_90 - Add new rule to convert annotations to attributes --- rector.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rector.php b/rector.php index 3a14cb8..1c26161 100644 --- a/rector.php +++ b/rector.php @@ -21,21 +21,20 @@ use Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector; use Rector\CodingStyle\Rector\Encapsed\WrapEncapsedVariableInCurlyBracesRector; use Rector\Config\RectorConfig; -use Rector\Core\Configuration\Option; -use Rector\Core\ValueObject\PhpVersion; +use Rector\Configuration\Option; use Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector; use Rector\DeadCode\Rector\ClassMethod\RemoveEmptyClassMethodRector; use Rector\EarlyReturn\Rector\If_\ChangeAndIfToEarlyReturnRector; use Rector\EarlyReturn\Rector\Return_\ReturnBinaryOrToEarlyReturnRector; use Rector\EarlyReturn\Rector\StmtsAwareInterface\ReturnEarlyIfVariableRector; use Rector\PHPUnit\CodeQuality\Rector\MethodCall\RemoveExpectAnyFromMockRector; -use Rector\PHPUnit\Set\PHPUnitLevelSetList; use Rector\PHPUnit\Set\PHPUnitSetList; use Rector\Set\ValueObject\DowngradeLevelSetList; use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\SetList; use Rector\Strict\Rector\BooleanNot\BooleanInBooleanNotRuleFixerRector; use Rector\TypeDeclaration\Rector\ClassMethod\StrictArrayParamDimFetchRector; +use Rector\ValueObject\PhpVersion; return static function (RectorConfig $rectorConfig): void { define('MHASH_XXH3', 2 << 0); @@ -145,8 +144,9 @@ SetList::EARLY_RETURN, SetList::INSTANCEOF, - PHPUnitLevelSetList::UP_TO_PHPUNIT_90, + PHPUnitSetList::PHPUNIT_90, PHPUnitSetList::PHPUNIT_CODE_QUALITY, + PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES, ]); $rectorConfig->rules([