@@ -364,12 +364,12 @@ public function getTestData(): iterable
364364 yield 'arbitrary inner join selected, and scalars (selection order variation) ' => [
365365 TypeCombinator::union (
366366 $ this ->constantArray ([
367- [new ConstantIntegerType (0 ), new ObjectType (Many ::class)],
367+ [new ConstantIntegerType (0 ), new ObjectType (One ::class)],
368368 ]),
369369 $ 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 ],
373373 ])
374374 ),
375375 '
@@ -1474,14 +1474,17 @@ public function getTestData(): iterable
14741474 }
14751475
14761476 /**
1477- * @param array<int,array{ConstantIntegerType|ConstantStringType,Type}> $elements
1477+ * @param array<int,array{0: ConstantIntegerType|ConstantStringType, 1: Type, 2?: bool }> $elements
14781478 */
14791479 private function constantArray (array $ elements ): Type
14801480 {
14811481 $ builder = ConstantArrayTypeBuilder::createEmpty ();
14821482
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 );
14851488 }
14861489
14871490 return $ builder ->getArray ();
0 commit comments