diff --git a/src/Guard/EmptyIssetGuard.php b/src/Guard/EmptyIssetGuard.php index a80cbb6b..e1680031 100644 --- a/src/Guard/EmptyIssetGuard.php +++ b/src/Guard/EmptyIssetGuard.php @@ -30,7 +30,7 @@ public function isLegal(Expr $expr, Scope $scope): bool return true; } - $varType = $scope->getType($expr); + $varType = $scope->getNativeType($expr); $varType = TypeCombinator::removeNull($varType); return $varType->getObjectClassNames() === []; } diff --git a/tests/Rules/NoEmptyOnObjectRule/Fixture/SkipPhpDocType.php b/tests/Rules/NoEmptyOnObjectRule/Fixture/SkipPhpDocType.php new file mode 100644 index 00000000..ec18890f --- /dev/null +++ b/tests/Rules/NoEmptyOnObjectRule/Fixture/SkipPhpDocType.php @@ -0,0 +1,12 @@ +