diff --git a/requirement-checker/rector-src.php b/requirement-checker/rector-src.php index ddf482591..ed8d99de4 100644 --- a/requirement-checker/rector-src.php +++ b/requirement-checker/rector-src.php @@ -6,20 +6,17 @@ use Rector\Set\ValueObject\DowngradeLevelSetList; use Rector\Set\ValueObject\LevelSetList; -return static function (RectorConfig $rectorConfig): void { +$applyCommonConfig = require __DIR__.'/rector.php'; + +return static function (RectorConfig $rectorConfig) use ($applyCommonConfig): void { + $applyCommonConfig($rectorConfig); + $rectorConfig->paths([ __DIR__ . '/src', ]); - $rectorConfig->autoloadPaths([ - __DIR__ . '/vendor/autoload.php', - __DIR__ . '/../vendor-bin/rector/vendor/autoload.php', - ]); - - $rectorConfig->importNames(); - $rectorConfig->sets([ - // TODO + LevelSetList::UP_TO_PHP_72, // DowngradeLevelSetList::DOWN_TO_PHP_72, ]); }; diff --git a/requirement-checker/rector-tests.php b/requirement-checker/rector-tests.php index adda3dbce..022c82102 100644 --- a/requirement-checker/rector-tests.php +++ b/requirement-checker/rector-tests.php @@ -3,21 +3,23 @@ declare(strict_types=1); use Rector\Config\RectorConfig; +use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector; use Rector\Set\ValueObject\LevelSetList; -return static function (RectorConfig $rectorConfig): void { +$applyCommonConfig = require __DIR__.'/rector.php'; + +return static function (RectorConfig $rectorConfig) use ($applyCommonConfig): void { + $applyCommonConfig($rectorConfig); + $rectorConfig->paths([ __DIR__ . '/tests', ]); - $rectorConfig->autoloadPaths([ - __DIR__ . '/vendor/autoload.php', - __DIR__ . '/../vendor-bin/rector/vendor/autoload.php', - ]); - - $rectorConfig->importNames(); - $rectorConfig->sets([ LevelSetList::UP_TO_PHP_82, ]); + + $rectorConfig->skip([ + ClosureToArrowFunctionRector::class + ]); }; diff --git a/requirement-checker/rector.php b/requirement-checker/rector.php new file mode 100644 index 000000000..55b3259b4 --- /dev/null +++ b/requirement-checker/rector.php @@ -0,0 +1,17 @@ +autoloadPaths([ + __DIR__ . '/vendor/autoload.php', + __DIR__ . '/../vendor-bin/rector/vendor/autoload.php', + ]); + + $rectorConfig->importNames(); +};