Skip to content

Commit

Permalink
Fix nextAutoIndex in getAllArrays()
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed May 9, 2020
1 parent f6fd473 commit 3eb6e79
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Type/Constant/ConstantArrayType.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,12 @@ public function getAllArrays(): array
$arrays = [];
foreach ($optionalKeysCombinations as $combination) {
$keys = array_merge($requiredKeys, $combination);
$keyTypes = [];
$valueTypes = [];
$builder = ConstantArrayTypeBuilder::createEmpty();
foreach ($keys as $i) {
$keyTypes[] = $this->keyTypes[$i];
$valueTypes[] = $this->valueTypes[$i];
$builder->setOffsetValueType($this->keyTypes[$i], $this->valueTypes[$i]);
}

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

return $this->allArrays = $arrays;
Expand Down

0 comments on commit 3eb6e79

Please sign in to comment.