Skip to content

Commit

Permalink
fix update_at mismatch of types
Browse files Browse the repository at this point in the history
  • Loading branch information
l-you committed Aug 16, 2024
1 parent 21baa73 commit 6e06e47
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Normalizer/CashRegisterModelNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,14 @@ public function denormalize(mixed $data, string $type, ?string $format = null, a
unset($data['created_at']);
}
if (array_key_exists('updated_at', $data)) {
$object->setUpdatedAt(null === $data['updated_at'] ? null : DateTime::createFromFormat('Y-m-d\\TH:i:sP', $data['updated_at']));
$updatedAt = null;
if ($data['updated_at'] !== null) {
$updatedAt = DateTime::createFromFormat('Y-m-d\\TH:i:sP', $data['updated_at']);
if ($updatedAt === false) {
$updatedAt = null;
}
}
$object->setUpdatedAt($updatedAt);
unset($data['updated_at']);
}
if (array_key_exists('number', $data)) {
Expand Down

0 comments on commit 6e06e47

Please sign in to comment.