diff --git a/rules/DeadCode/Rector/If_/RemoveDeadInstanceOfRector.php b/rules/DeadCode/Rector/If_/RemoveDeadInstanceOfRector.php index 4003d586319..a0f97fa4ae9 100644 --- a/rules/DeadCode/Rector/If_/RemoveDeadInstanceOfRector.php +++ b/rules/DeadCode/Rector/If_/RemoveDeadInstanceOfRector.php @@ -14,7 +14,6 @@ use PhpParser\Node\Expr\PropertyFetch; use PhpParser\Node\Expr\StaticPropertyFetch; use PhpParser\Node\Name; -use PhpParser\Node\Name\FullyQualified; use PhpParser\Node\Stmt; use PhpParser\Node\Stmt\Expression; use PhpParser\Node\Stmt\If_; @@ -158,10 +157,6 @@ private function isInstanceofTheSameType(Instanceof_ $instanceof): ?bool return null; } - if (! $instanceof->class instanceof FullyQualified) { - return null; - } - $exprType = $this->nodeTypeResolver->getNativeType($instanceof->expr); if (! $exprType instanceof ObjectType) { return null;