From f7732d1a77107284fa159eaf6a5b4752547e979f Mon Sep 17 00:00:00 2001 From: Brady McDonough Date: Thu, 15 Feb 2024 15:50:36 -0700 Subject: [PATCH] Fix request clock --- src/Clock/Request.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Clock/Request.php b/src/Clock/Request.php index b9a4a8f..afe908d 100644 --- a/src/Clock/Request.php +++ b/src/Clock/Request.php @@ -4,6 +4,7 @@ namespace BradyMcD\TAATP\Clock; use DateTimeImmutable; +/** @SuppressWarnings(PHPMD.Superglobals)*/ class Request implements \Psr\Clock\ClockInterface { private $time; @@ -15,7 +16,7 @@ class Request implements \Psr\Clock\ClockInterface public function now(): DateTimeImmutable { - return new DateTimeImmutable($this->time); + return (new DateTimeImmutable())->setTimestamp($this->time); } }