Skip to content

Commit 2bf8629

Browse files
authored
fix(Spanner): null array offset in value mapper (#8949)
1 parent ce7b28f commit 2bf8629

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

Spanner/src/ValueMapper.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -851,11 +851,14 @@ private function typeObject(
851851
array $nestedDefinition = [],
852852
string|null $nestedDefinitionType = null
853853
): array {
854-
return array_filter([
854+
$result = [
855855
'code' => $type,
856-
$nestedDefinitionType => $nestedDefinition,
857856
'typeAnnotation' => $typeAnnotation
858-
]);
857+
];
858+
if (null !== $nestedDefinitionType) {
859+
$result[$nestedDefinitionType] = $nestedDefinition;
860+
}
861+
return array_filter($result);
859862
}
860863

861864
/**

0 commit comments

Comments
 (0)