Skip to content

Commit f4eec2f

Browse files
committed
Update DateTimeTrait.php
1 parent f3d7ae7 commit f4eec2f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/Context/DateTimeTrait.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,8 @@ private function unixTimeToDateTime(?float $microtime): ?\DateTimeImmutable
1212
}
1313

1414
$datetime = \DateTimeImmutable::createFromFormat('U.u', number_format($microtime, 6, '.', '')) ?: null;
15-
if ($datetime === null) {
16-
return null;
17-
}
1815

19-
return $datetime->setTimezone(new \DateTimeZone(date_default_timezone_get()));
16+
return $datetime?->setTimezone(new \DateTimeZone(date_default_timezone_get()));
2017
}
2118

2219
}

0 commit comments

Comments
 (0)