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())); } }