Skip to content

Commit

Permalink
fix: undefined array index 0 due to array_filter() (#530)
Browse files Browse the repository at this point in the history
  • Loading branch information
kburton-dev authored Sep 9, 2024
1 parent 3bc745c commit 4752b98
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Support/TypeToSchemaExtensions/FlattensMergeValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ protected function flattenMergeValues(array $items)
$item->value instanceof Union
&& (new TypeWalker)->first($item->value, fn (Type $t) => $t->isInstanceOf(MissingValue::class))
) {
$newType = array_filter($item->value->types, fn (Type $t) => ! $t->isInstanceOf(MissingValue::class));
$newType = array_values(
array_filter($item->value->types, fn (Type $t) => ! $t->isInstanceOf(MissingValue::class))
);

if (! count($newType)) {
return [];
Expand Down

0 comments on commit 4752b98

Please sign in to comment.