From cfdbe583fd42dceb8e107d077e13916fc1b6cbbc Mon Sep 17 00:00:00 2001 From: mjansen Date: Tue, 8 Mar 2022 09:27:35 +0100 Subject: [PATCH] Clock: Introduce `PSR-20 Clock Service` --- src/Data/Clock/ClockFactory.php | 4 +++- src/Data/Clock/ClockFactoryImpl.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Data/Clock/ClockFactory.php b/src/Data/Clock/ClockFactory.php index 6c25c637e7da..0f773169c0dd 100644 --- a/src/Data/Clock/ClockFactory.php +++ b/src/Data/Clock/ClockFactory.php @@ -16,11 +16,13 @@ namespace ILIAS\Data\Clock; +use DateTimeZone; + interface ClockFactory { public function system() : ClockInterface; public function utc() : ClockInterface; - public function local(\DateTimeZone $time_zone) : ClockInterface; + public function local(DateTimeZone $time_zone) : ClockInterface; } diff --git a/src/Data/Clock/ClockFactoryImpl.php b/src/Data/Clock/ClockFactoryImpl.php index 180d05710971..169ebe627517 100644 --- a/src/Data/Clock/ClockFactoryImpl.php +++ b/src/Data/Clock/ClockFactoryImpl.php @@ -16,6 +16,8 @@ namespace ILIAS\Data\Clock; +use DateTimeZone; + class ClockFactoryImpl implements ClockFactory { /** @@ -37,7 +39,7 @@ public function utc() : ClockInterface /** * @inheritDoc */ - public function local(\DateTimeZone $time_zone) : ClockInterface + public function local(DateTimeZone $time_zone) : ClockInterface { return new LocalClock($time_zone); }