Skip to content

Commit a16f84c

Browse files
committed
Update SpecifiedTypes.php
1 parent 2301b9e commit a16f84c

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/Analyser/SpecifiedTypes.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
final class SpecifiedTypes
1414
{
1515

16-
private const MAX_SURE_NOT_TYPES = 8;
16+
private const MAX_ADDED_TYPES = 8;
1717

1818
private bool $overwrite = false;
1919

@@ -172,6 +172,10 @@ public function unionWith(SpecifiedTypes $other): self
172172
continue;
173173
}
174174

175+
if ($type instanceof UnionType && count($type->getTypes()) >= self::MAX_ADDED_TYPES) {
176+
continue;
177+
}
178+
175179
$sureTypeUnion[$exprString] = [
176180
$exprNode,
177181
TypeCombinator::intersect($type, $other->sureTypes[$exprString][1]),
@@ -183,7 +187,7 @@ public function unionWith(SpecifiedTypes $other): self
183187
continue;
184188
}
185189

186-
if ($type instanceof UnionType && count($type->getTypes()) >= self::MAX_SURE_NOT_TYPES) {
190+
if ($type instanceof UnionType && count($type->getTypes()) >= self::MAX_ADDED_TYPES) {
187191
continue;
188192
}
189193

0 commit comments

Comments
 (0)