Skip to content

Commit

Permalink
wip: datetime from timestamp
Browse files Browse the repository at this point in the history
for #360
  • Loading branch information
g105b committed Oct 11, 2023
1 parent ceac0a6 commit 66de02b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Fetchable.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ protected function castRow(
$key = key($assocArray);
$value = $assocArray[$key];

if($type === Type::DATETIME && is_numeric($value)) {
$value = "@$value";

Check warning on line 148 in src/Fetchable.php

View check run for this annotation

Codecov / codecov/patch

src/Fetchable.php#L148

Added line #L148 was not covered by tests
}

return match ($type) {
Type::BOOL, "boolean" => (bool)$value,
Type::INT, "integer" => (int)$value,
Expand Down

0 comments on commit 66de02b

Please sign in to comment.