Skip to content

Commit 3eb6e79

Browse files
committed
Fix nextAutoIndex in getAllArrays()
1 parent f6fd473 commit 3eb6e79

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Type/Constant/ConstantArrayType.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,12 @@ public function getAllArrays(): array
120120
$arrays = [];
121121
foreach ($optionalKeysCombinations as $combination) {
122122
$keys = array_merge($requiredKeys, $combination);
123-
$keyTypes = [];
124-
$valueTypes = [];
123+
$builder = ConstantArrayTypeBuilder::createEmpty();
125124
foreach ($keys as $i) {
126-
$keyTypes[] = $this->keyTypes[$i];
127-
$valueTypes[] = $this->valueTypes[$i];
125+
$builder->setOffsetValueType($this->keyTypes[$i], $this->valueTypes[$i]);
128126
}
129127

130-
$arrays[] = new self($keyTypes, $valueTypes, 0 /*TODO*/, []);
128+
$arrays[] = $builder->getArray();
131129
}
132130

133131
return $this->allArrays = $arrays;

0 commit comments

Comments
 (0)