Skip to content

Commit 7b2efea

Browse files
committed
Return early on condition if $key is null
This change fixes the situation whenever a call to `array_key_exists` with `$key` set to `null` would trigger a deprecation notice.
1 parent bc1c5cb commit 7b2efea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Formatter/ArrayBasedDeformatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public function deserializeObject(mixed $decoded, Field $field, Deserializer $de
236236
first(static fn (string $name): bool => isset($decoded[$name]))
237237
);
238238

239-
if (!array_key_exists($key, $decoded)) {
239+
if ($key === null || !array_key_exists($key, $decoded)) {
240240
return DeformatterResult::Missing;
241241
}
242242

0 commit comments

Comments
 (0)