Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Nov 17, 2023
1 parent a9851db commit 67893d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/Rules/PhpDoc/VarTagTypeRuleHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ private function checkType(Type $type, Type $varTagType): bool
return $this->checkType($innerType, $innerVarTagType);
}

if ($type->isConstantValue()->yes()) {
return $type->isSuperTypeOf($varTagType)->no();
}

return !$type->isSuperTypeOf($varTagType)->yes();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,6 @@ public function testEmptyArrayInitWithWiderPhpDoc(bool $checkTypeAgainstNativeTy
$errors = !$checkTypeAgainstNativeType
? []
: [
[
'PHPDoc tag @var with type int|null is not subtype of native type null.',
6,
],
[
'PHPDoc tag @var with type int is not subtype of native type array{}.',
24,
Expand Down

0 comments on commit 67893d4

Please sign in to comment.