From 14e63f06f7d881d334078b5144dac7e737eaebdb Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Fri, 11 Sep 2026 09:26:51 +0300 Subject: [PATCH] Update rector --- composer.json | 2 +- rector.php | 4 ---- src/Rule/Nested.php | 4 +--- tests/BaseConfigTestCase.php | 4 +--- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index c6a9b6186..03d2d8cf2 100644 --- a/composer.json +++ b/composer.json @@ -44,7 +44,7 @@ "jetbrains/phpstorm-attributes": "^1.2", "phpbench/phpbench": "^1.4.1", "phpunit/phpunit": "^10.5.46", - "rector/rector": "^2.0.16", + "rector/rector": "^2.6.6", "shipmonk/composer-dependency-analyser": "^1.8", "spatie/phpunit-watcher": "^1.24", "yiisoft/di": "^1.3", diff --git a/rector.php b/rector.php index 3c7f41fc8..82af152df 100644 --- a/rector.php +++ b/rector.php @@ -6,8 +6,6 @@ use Rector\Config\RectorConfig; use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector; use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector; -use Rector\Php81\Rector\ClassMethod\NewInInitializerRector; -use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector; use Rector\PHPUnit\AnnotationsToAttributes\Rector\ClassMethod\DataProviderAnnotationToAttributeRector; use Rector\PHPUnit\PHPUnit100\Rector\Class_\StaticDataProviderClassMethodRector; @@ -24,8 +22,6 @@ ]) ->withSkip([ ClosureToArrowFunctionRector::class, - NullToStrictStringFuncCallArgRector::class, - NewInInitializerRector::class, ClassPropertyAssignToConstructorPromotionRector::class => [ __DIR__ . '/src/Rule/Composite.php', ], diff --git a/src/Rule/Nested.php b/src/Rule/Nested.php index bfe62aefa..8f836c705 100644 --- a/src/Rule/Nested.php +++ b/src/Rule/Nested.php @@ -590,9 +590,7 @@ private function handleEachShortcut(array &$rules): void $remainingValuePath = implode(self::EACH_SHORTCUT, $parts); $remainingValuePath = rtrim($remainingValuePath, self::SEPARATOR); - if (!isset($rulesMap[$remainingValuePath])) { - $rulesMap[$remainingValuePath] = []; - } + $rulesMap[$remainingValuePath] ??= []; $rulesMap[$remainingValuePath][$lastValuePath] = $rule; unset($rules[$valuePath]); diff --git a/tests/BaseConfigTestCase.php b/tests/BaseConfigTestCase.php index 027e5b8b7..f74d91453 100644 --- a/tests/BaseConfigTestCase.php +++ b/tests/BaseConfigTestCase.php @@ -21,9 +21,7 @@ final protected function createContainer(?array $params = null): Container final protected function getContainerDefinitions(?array $params): array { - if ($params === null) { - $params = $this->getParams(); - } + $params ??= $this->getParams(); return require dirname(__DIR__) . '/config/di.php'; }