Skip to content

Commit 1636a63

Browse files
committed
fix: ignore mix type to avoid false positive
1 parent f225541 commit 1636a63

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Rules/NameNodeHolderFindRule.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use PHPStan\Node\InClassNode;
99
use PHPStan\Rules\RuleErrorBuilder;
1010
use PHPStan\Type\ArrayType;
11+
use PHPStan\Type\MixedType;
1112
use PHPStan\Type\ObjectType;
1213

1314
class NameNodeHolderFindRule implements Rule
@@ -34,6 +35,9 @@ public function processNode(Node $node, Scope $scope): array
3435
if ($propertyType instanceof ArrayType) {
3536
$propertyType = $propertyType->getItemType();
3637
}
38+
if ($propertyType instanceof MixedType) {
39+
continue;
40+
}
3741
$trinary = $propertyType->isSuperTypeOf(new ObjectType('PhpParser\Node\Name'));
3842
if (!$trinary->no()) {
3943
return [

0 commit comments

Comments
 (0)