From f4eec2f4f0392d76659acc060ff2e5c544d46b54 Mon Sep 17 00:00:00 2001 From: Libor M Date: Fri, 12 May 2023 09:16:44 +0200 Subject: [PATCH] Update DateTimeTrait.php --- src/Context/DateTimeTrait.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Context/DateTimeTrait.php b/src/Context/DateTimeTrait.php index 5a1a1ad..080e82a 100644 --- a/src/Context/DateTimeTrait.php +++ b/src/Context/DateTimeTrait.php @@ -12,11 +12,8 @@ private function unixTimeToDateTime(?float $microtime): ?\DateTimeImmutable } $datetime = \DateTimeImmutable::createFromFormat('U.u', number_format($microtime, 6, '.', '')) ?: null; - if ($datetime === null) { - return null; - } - return $datetime->setTimezone(new \DateTimeZone(date_default_timezone_get())); + return $datetime?->setTimezone(new \DateTimeZone(date_default_timezone_get())); } }