We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8356533 commit c2c86e3Copy full SHA for c2c86e3
1 file changed
utils/Rector/MakeUseOfContainsStmtsRector.php
@@ -18,6 +18,7 @@
18
use PhpParser\Node\Stmt\Foreach_;
19
use PhpParser\Node\Stmt\Function_;
20
use PhpParser\NodeVisitor;
21
+use PHPStan\Reflection\ClassReflection;
22
use PHPStan\Type\ObjectType;
23
use Rector\PhpParser\Node\Value\ValueResolver;
24
use Rector\Rector\AbstractRector;
@@ -92,6 +93,7 @@ public function refactor(Node $node): MethodCall|Identical|null|int
92
93
94
$callerType = $this->getType($node->var);
95
if ($callerType instanceof ObjectType) {
96
+ /** @var ClassReflection $callerClassReflection */
97
$callerClassReflection = $callerType->getClassReflection();
98
if (! $callerClassReflection->isInterface()) {
99
// we have to match interface exactly
0 commit comments