Skip to content

Commit f22802f

Browse files
authored
[CodeQuality] Skip first class callable on ParameterBagTypedGetMethodCallRector (#835)
* [CodeQuality] Skip first class callable on ParameterBagTypedGetMethodCallRector * [CodeQuality] Skip first class callable on ParameterBagTypedGetMethodCallRector
1 parent 108091b commit f22802f

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace Rector\Symfony\Tests\CodeQuality\Rector\MethodCall\ParameterBagTypedGetMethodCallRector\Fixture;
4+
5+
use Symfony\Component\HttpFoundation\Request;
6+
7+
final class SkipFirstClassCallable
8+
{
9+
public function run(Request $request)
10+
{
11+
$debug = (bool) $request->query->get(...);
12+
}
13+
}

rules/CodeQuality/Rector/MethodCall/ParameterBagTypedGetMethodCallRector.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ public function refactor(Node $node): ?Node
8888

8989
private function refactorMethodCall(MethodCall $methodCall): ?MethodCall
9090
{
91+
if ($methodCall->isFirstClassCallable()) {
92+
return null;
93+
}
94+
9195
// default value must be defined
9296
if (count($methodCall->getArgs()) !== 2) {
9397
return null;

0 commit comments

Comments
 (0)