@@ -341,12 +341,15 @@ protected function testOptionalKeysInUnionArray($row): void
341
341
342
342
/**
343
343
* @param array{string}|list{0: int, 1?: string|null, 2?: int|null, 3?: float|null} $row
344
+ * @param list<string> $listRow
344
345
* @param int<2, 3> $twoOrThree
345
346
* @param int<2, max> $twoOrMore
346
347
* @param int<min, 3> $maxThree
347
348
* @param int<10, 11> $tenOrEleven
349
+ * @param int<3, 32> $threeOrMoreInRangeLimit
350
+ * @param int<3, 512> $threeOrMoreOverRangeLimit
348
351
*/
349
- protected function testOptionalKeysInUnionListWithIntRange ($ row , $ twoOrThree , $ twoOrMore , int $ maxThree , $ tenOrEleven ): void
352
+ protected function testOptionalKeysInUnionListWithIntRange ($ row , $ listRow , $ twoOrThree , $ twoOrMore , int $ maxThree , $ tenOrEleven, $ threeOrMoreInRangeLimit , $ threeOrMoreOverRangeLimit ): void
350
353
{
351
354
if (count ($ row ) >= $ twoOrThree ) {
352
355
assertType ('array{0: int, 1: string|null, 2?: int|null} ' , $ row );
@@ -371,6 +374,30 @@ protected function testOptionalKeysInUnionListWithIntRange($row, $twoOrThree, $t
371
374
} else {
372
375
assertType ('array{string}|list{0: int, 1?: string|null, 2?: int|null, 3?: float|null} ' , $ row );
373
376
}
377
+
378
+ if (count ($ row ) >= $ threeOrMoreInRangeLimit ) {
379
+ assertType ('list{0: int, 1?: string|null, 2?: int|null, 3?: float|null} ' , $ row );
380
+ } else {
381
+ assertType ('array{string}|list{0: int, 1?: string|null, 2?: int|null, 3?: float|null} ' , $ row );
382
+ }
383
+
384
+ if (count ($ listRow ) >= $ threeOrMoreInRangeLimit ) {
385
+ assertType ('list{0: string, 1: string, 2: string, 3?: string, 4?: string, 5?: string, 6?: string, 7?: string, 8?: string, 9?: string, 10?: string, 11?: string, 12?: string, 13?: string, 14?: string, 15?: string, 16?: string, 17?: string, 18?: string, 19?: string, 20?: string, 21?: string, 22?: string, 23?: string, 24?: string, 25?: string, 26?: string, 27?: string, 28?: string, 29?: string, 30?: string, 31?: string} ' , $ listRow );
386
+ } else {
387
+ assertType ('list<string> ' , $ listRow );
388
+ }
389
+
390
+ if (count ($ row ) >= $ threeOrMoreOverRangeLimit ) {
391
+ assertType ('list{0: int, 1?: string|null, 2?: int|null, 3?: float|null} ' , $ row );
392
+ } else {
393
+ assertType ('array{string}|list{0: int, 1?: string|null, 2?: int|null, 3?: float|null} ' , $ row );
394
+ }
395
+
396
+ if (count ($ listRow ) >= $ threeOrMoreOverRangeLimit ) {
397
+ assertType ('non-empty-list<string> ' , $ listRow );
398
+ } else {
399
+ assertType ('list<string> ' , $ listRow );
400
+ }
374
401
}
375
402
376
403
/**
0 commit comments