Skip to content

Commit 80b40f2

Browse files
committed
Limit how big int-mask type can be
1 parent 572e0e8 commit 80b40f2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/PhpDoc/TypeNodeResolver.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,6 +1234,10 @@ private function expandIntMaskToType(Type $type): ?Type
12341234
return IntegerRangeType::fromInterval($min, $max);
12351235
}
12361236

1237+
if (count($values) > InitializerExprTypeResolver::CALCULATE_SCALARS_LIMIT) {
1238+
return IntegerRangeType::fromInterval($min, $max);
1239+
}
1240+
12371241
return TypeCombinator::union(...array_map(static fn ($value) => new ConstantIntegerType($value), $values));
12381242
}
12391243

0 commit comments

Comments
 (0)