Skip to content

Commit

Permalink
refactor(config): update PHP version and sets
Browse files Browse the repository at this point in the history
- Update PHP version from 7.2 to 7.4
- Update downgrade and level sets to PHP 7.4
- Update PHPUnit sets to PHPUnit 9.0
- Add annotations to attributes set
  • Loading branch information
guanguans committed Jan 23, 2024
1 parent 5c2615b commit 31bc189
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,17 @@
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\PHPUnit\CodeQuality\Rector\Class_\AddSeeTestAnnotationRector;
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\ValueObject\PhpVersion;

return static function (RectorConfig $rectorConfig): void {
define('MHASH_XXH3', 2 << 0);
Expand All @@ -44,7 +43,7 @@
// $rectorConfig->disableParallel();
$rectorConfig->parallel(240);
$rectorConfig->phpstanConfig(__DIR__.'/phpstan.neon');
$rectorConfig->phpVersion(PhpVersion::PHP_72);
$rectorConfig->phpVersion(PhpVersion::PHP_74);
// $rectorConfig->cacheClass(FileCacheStorage::class);
// $rectorConfig->cacheDirectory(__DIR__.'/build/rector');
// $rectorConfig->containerCacheDirectory(__DIR__.'/build/rector');
Expand Down Expand Up @@ -109,8 +108,8 @@
]);

$rectorConfig->sets([
DowngradeLevelSetList::DOWN_TO_PHP_72,
LevelSetList::UP_TO_PHP_72,
DowngradeLevelSetList::DOWN_TO_PHP_74,
LevelSetList::UP_TO_PHP_74,
// SetList::ACTION_INJECTION_TO_CONSTRUCTOR_INJECTION,
SetList::CODE_QUALITY,
SetList::CODING_STYLE,
Expand All @@ -125,8 +124,9 @@
SetList::EARLY_RETURN,
SetList::INSTANCEOF,

PHPUnitLevelSetList::UP_TO_PHPUNIT_80,
PHPUnitSetList::PHPUNIT_90,
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES,
]);

$rectorConfig->rules([
Expand Down

0 comments on commit 31bc189

Please sign in to comment.