From f85f21d2ea66b91640366d5174f1a6d05a39ea6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= <5175937+theofidry@users.noreply.github.com> Date: Mon, 17 Jun 2024 21:05:33 +0200 Subject: [PATCH] build: Upgrade to Rector v1 (#1378) --- rector.php | 25 ++++++++++--------------- vendor-bin/rector/composer.json | 2 +- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/rector.php b/rector.php index 99928f3d9..9c6784cb7 100644 --- a/rector.php +++ b/rector.php @@ -6,25 +6,21 @@ use Rector\PHPUnit\Set\PHPUnitSetList; use Rector\Set\ValueObject\LevelSetList; -return static function (RectorConfig $rectorConfig): void { - $rectorConfig->paths([ +return RectorConfig::configure() + ->withPaths([ __DIR__ . '/src', __DIR__ . '/tests', - ]); - - $rectorConfig->autoloadPaths([ + ]) + ->withAutoloadPaths([ __DIR__ . '/vendor/autoload.php', __DIR__ . '/vendor-bin/rector/vendor/autoload.php', - ]); - - $rectorConfig->importNames(); - - $rectorConfig->sets([ - LevelSetList::UP_TO_PHP_82, + ]) + ->withImportNames(removeUnusedImports: true) + ->withPhpSets(php82: true) + ->withSets([ PHPUnitSetList::PHPUNIT_100, - ]); - - $rectorConfig->skip([ + ]) + ->withSkip([ \Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector::class, \Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector::class, \Rector\Php55\Rector\String_\StringClassNameToClassConstantRector::class => [ @@ -32,4 +28,3 @@ ], \Rector\Php73\Rector\String_\SensitiveHereNowDocRector::class, ]); -}; diff --git a/vendor-bin/rector/composer.json b/vendor-bin/rector/composer.json index 1d58026d1..22701b9ab 100644 --- a/vendor-bin/rector/composer.json +++ b/vendor-bin/rector/composer.json @@ -1,6 +1,6 @@ { "require-dev": { - "rector/rector": ">=0.14" + "rector/rector": "^1.0" }, "config": {