Skip to content

Commit 529fa96

Browse files
committed
Fix build
1 parent c5ec462 commit 529fa96

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
],
88
"require": {
99
"php": "^7.2 || ^8.0",
10-
"phpstan/phpstan": "^1.8.0"
10+
"phpstan/phpstan": "^1.8.3"
1111
},
1212
"conflict": {
1313
"doctrine/collections": "<1.0",

tests/Type/Doctrine/Query/QueryResultTypeWalkerTest.php

+10-7
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)