@@ -364,12 +364,12 @@ public function getTestData(): iterable
364
364
yield 'arbitrary inner join selected, and scalars (selection order variation) ' => [
365
365
TypeCombinator::union (
366
366
$ this ->constantArray ([
367
- [new ConstantIntegerType (0 ), new ObjectType (Many ::class)],
367
+ [new ConstantIntegerType (0 ), new ObjectType (One ::class)],
368
368
]),
369
369
$ this ->constantArray ([
370
- [new ConstantIntegerType (0 ), new ObjectType (One ::class)],
371
- [new ConstantStringType ('id ' ), new StringType ()],
372
- [new ConstantStringType ('intColumn ' ), new IntegerType ()],
370
+ [new ConstantIntegerType (0 ), new ObjectType (Many ::class)],
371
+ [new ConstantStringType ('id ' ), new StringType (), true ],
372
+ [new ConstantStringType ('intColumn ' ), new IntegerType (), true ],
373
373
])
374
374
),
375
375
'
@@ -1474,14 +1474,17 @@ public function getTestData(): iterable
1474
1474
}
1475
1475
1476
1476
/**
1477
- * @param array<int,array{ConstantIntegerType|ConstantStringType,Type}> $elements
1477
+ * @param array<int,array{0: ConstantIntegerType|ConstantStringType, 1: Type, 2?: bool }> $elements
1478
1478
*/
1479
1479
private function constantArray (array $ elements ): Type
1480
1480
{
1481
1481
$ builder = ConstantArrayTypeBuilder::createEmpty ();
1482
1482
1483
- foreach ($ elements as [$ offsetType , $ valueType ]) {
1484
- $ builder ->setOffsetValueType ($ offsetType , $ valueType );
1483
+ foreach ($ elements as $ element ) {
1484
+ $ offsetType = $ element [0 ];
1485
+ $ valueType = $ element [1 ];
1486
+ $ optional = $ element [2 ] ?? false ;
1487
+ $ builder ->setOffsetValueType ($ offsetType , $ valueType , $ optional );
1485
1488
}
1486
1489
1487
1490
return $ builder ->getArray ();
0 commit comments