File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313final 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
You can’t perform that action at this time.
0 commit comments