Skip to content

Commit 158a72e

Browse files
authored
[CodeQuality] Skip first class callable on StringCastDebugResponseRector (#803)
1 parent 94424e0 commit 158a72e

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
namespace Rector\Symfony\Tests\CodeQuality\Rector\MethodCall\StringCastDebugResponseRector\Fixture;
4+
5+
use PHPUnit\Framework\TestCase;
6+
use Symfony\Component\HttpFoundation\Response;
7+
8+
final class SkipFirstClassCallable extends TestCase
9+
{
10+
public function test(Response $response)
11+
{
12+
$this->assertSame(...);
13+
}
14+
}

rules/CodeQuality/Rector/MethodCall/StringCastDebugResponseRector.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ public function refactor(Node $node): ?Node
8282
return null;
8383
}
8484

85+
if ($node->isFirstClassCallable()) {
86+
return null;
87+
}
88+
8589
// there cannot be any custom message
8690
$args = $node->getArgs();
8791
if (count($args) !== 3) {

0 commit comments

Comments
 (0)