diff --git a/rules-tests/Transform/Rector/FileWithoutNamespace/RectorConfigBuilderRector/Fixture/disable_parallel_to_without_parallel.php.inc b/rules-tests/Transform/Rector/FileWithoutNamespace/RectorConfigBuilderRector/Fixture/disable_parallel_to_without_parallel.php.inc new file mode 100644 index 00000000000..612682860ed --- /dev/null +++ b/rules-tests/Transform/Rector/FileWithoutNamespace/RectorConfigBuilderRector/Fixture/disable_parallel_to_without_parallel.php.inc @@ -0,0 +1,21 @@ +disableParallel(); +}; + +?> +----- +withoutParallel(); + +?> diff --git a/rules/Transform/Rector/FileWithoutNamespace/RectorConfigBuilderRector.php b/rules/Transform/Rector/FileWithoutNamespace/RectorConfigBuilderRector.php index cf556b4cf3a..52021b979df 100644 --- a/rules/Transform/Rector/FileWithoutNamespace/RectorConfigBuilderRector.php +++ b/rules/Transform/Rector/FileWithoutNamespace/RectorConfigBuilderRector.php @@ -114,9 +114,17 @@ public function refactor(Node $node): ?Node } $args = $rectorConfigStmt->expr->getArgs(); - $value = $args[0]->value; $name = $this->getName($rectorConfigStmt->expr->name); + if ($name === 'disableParallel') { + $newExpr = $this->nodeFactory->createMethodCall($newExpr, 'withoutParallel'); + $hasChanged = true; + + continue; + } + + $value = $args[0]->value; + if ($name === 'rule') { Assert::isAOf($rules, Array_::class); $rules->items[] = new ArrayItem($value);