Skip to content

Commit 653704d

Browse files
authored
Merge pull request #52 from nutgram/fix/handle-null-values-correctly
fix: handle null values correctly in EnumOrScalar property resolution
2 parents 4d361d7 + 37dafc6 commit 653704d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Resolver/EnumOrScalar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function resolve(string $propertyName, array $propertyTypes, array $data)
2929
);
3030
}
3131

32-
$value = $data[$propertyName] ?? array_shift($data);
32+
$value = array_key_exists($propertyName, $data) ? $data[$propertyName] : array_shift($data);
3333
if ((is_string($value) || is_int($value)) && $enumClass::tryFrom($value) !== null) {
3434
return $enum;
3535
}

0 commit comments

Comments
 (0)