Skip to content

Commit

Permalink
fix update_at missmatch of types (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
l-you authored Jul 23, 2024
1 parent 6bc36cb commit 7864e4b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Normalizer/CashierModelNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,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:s.uP', $data['updated_at']));
$updatedAt = null;
if ($data['updated_at'] !== null) {
$updatedAt = DateTime::createFromFormat('Y-m-d\\TH:i:s.uP', $data['updated_at']);
if ($updatedAt === false) {
$updatedAt = null;
}
}
$object->setUpdatedAt($updatedAt);
unset($data['updated_at']);
}
if (array_key_exists('certificate_end', $data)) {
Expand Down

0 comments on commit 7864e4b

Please sign in to comment.