diff --git a/rules-tests/CodingStyle/Rector/FuncCall/CallUserFuncToMethodCallRector/Fixture/pass_arg.php.inc b/rules-tests/CodingStyle/Rector/FuncCall/CallUserFuncToMethodCallRector/Fixture/pass_arg.php.inc new file mode 100644 index 00000000000..11ddcdc6933 --- /dev/null +++ b/rules-tests/CodingStyle/Rector/FuncCall/CallUserFuncToMethodCallRector/Fixture/pass_arg.php.inc @@ -0,0 +1,35 @@ +args = call_user_func([$this, 'args'], $args); + } + } +} + +?> +----- +args = $this->args($args); + } + } +} + +?> diff --git a/rules/CodingStyle/Rector/FuncCall/CallUserFuncToMethodCallRector.php b/rules/CodingStyle/Rector/FuncCall/CallUserFuncToMethodCallRector.php index 3b4010d34d6..66472e5bd46 100644 --- a/rules/CodingStyle/Rector/FuncCall/CallUserFuncToMethodCallRector.php +++ b/rules/CodingStyle/Rector/FuncCall/CallUserFuncToMethodCallRector.php @@ -90,7 +90,7 @@ public function refactor(Node $node): ?Node $originalArgs = $node->args; unset($originalArgs[0]); - $methodCall->args = $originalArgs; + $methodCall->args = array_values($originalArgs); return $methodCall; } }