diff --git a/rules-tests/CodeQuality/Rector/MethodCall/ParameterBagTypedGetMethodCallRector/Fixture/skip_first_class_callable.php.inc b/rules-tests/CodeQuality/Rector/MethodCall/ParameterBagTypedGetMethodCallRector/Fixture/skip_first_class_callable.php.inc new file mode 100644 index 000000000..d8bc4a3f1 --- /dev/null +++ b/rules-tests/CodeQuality/Rector/MethodCall/ParameterBagTypedGetMethodCallRector/Fixture/skip_first_class_callable.php.inc @@ -0,0 +1,13 @@ +query->get(...); + } +} diff --git a/rules/CodeQuality/Rector/MethodCall/ParameterBagTypedGetMethodCallRector.php b/rules/CodeQuality/Rector/MethodCall/ParameterBagTypedGetMethodCallRector.php index ddcd94eaa..fecaf28f1 100644 --- a/rules/CodeQuality/Rector/MethodCall/ParameterBagTypedGetMethodCallRector.php +++ b/rules/CodeQuality/Rector/MethodCall/ParameterBagTypedGetMethodCallRector.php @@ -88,6 +88,10 @@ public function refactor(Node $node): ?Node private function refactorMethodCall(MethodCall $methodCall): ?MethodCall { + if ($methodCall->isFirstClassCallable()) { + return null; + } + // default value must be defined if (count($methodCall->getArgs()) !== 2) { return null;