Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .fernignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Specify files that shouldn't be modified by Fern
LICENSE.md
CONTRIBUTING.md

# nullable DateTime fix
src/Core/Json/JsonSerializableType.php
4 changes: 4 additions & 0 deletions src/Core/Json/JsonSerializableType.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ public static function jsonDeserialize(array $data): static
$dateTypeAttr = $property->getAttributes(Date::class)[0] ?? null;
if ($dateTypeAttr) {
$dateType = $dateTypeAttr->newInstance()->type;
if ($value === null) {
$args[$property->getName()] = null;
continue;
}
if (!is_string($value)) {
throw new JsonException("Unexpected non-string type for date.");
}
Expand Down
Loading