From 609c22115abb9be5aad39b06346e8a2adfde8459 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Mon, 1 Sep 2025 18:23:18 +0700 Subject: [PATCH 1/2] [CodeQuality] Skip first class callable on ParameterBagTypedGetMethodCallRector --- .../MethodCall/ParameterBagTypedGetMethodCallRector.php | 4 ++++ 1 file changed, 4 insertions(+) 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; From 0889e46148f56d14e82d187dc37323c715c63d48 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Mon, 1 Sep 2025 18:23:24 +0700 Subject: [PATCH 2/2] [CodeQuality] Skip first class callable on ParameterBagTypedGetMethodCallRector --- .../Fixture/skip_first_class_callable.php.inc | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 rules-tests/CodeQuality/Rector/MethodCall/ParameterBagTypedGetMethodCallRector/Fixture/skip_first_class_callable.php.inc 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(...); + } +}