From 48c449b37e581f6ca7747cbcb290b306ee6afbc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gamez?= Date: Fri, 12 Sep 2025 16:03:47 +0200 Subject: [PATCH] Import classes instead of using FQNs --- src/Clock/WrappingClock.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Clock/WrappingClock.php b/src/Clock/WrappingClock.php index 2e91b55..16d9eab 100644 --- a/src/Clock/WrappingClock.php +++ b/src/Clock/WrappingClock.php @@ -6,6 +6,7 @@ namespace Beste\Clock; use Beste\Clock; use DateTimeImmutable; +use InvalidArgumentException; use Psr\Clock\ClockInterface; final class WrappingClock implements Clock @@ -24,11 +25,11 @@ final class WrappingClock implements Clock } if (!method_exists($clock, 'now')) { - throw new \InvalidArgumentException('$clock must implement StellaMaris\Clock\ClockInterface or have a now() method'); + throw new InvalidArgumentException('$clock must implement StellaMaris\Clock\ClockInterface or have a now() method'); } if (!($clock->now() instanceof DateTimeImmutable)) { - throw new \InvalidArgumentException('$clock->now() must return a DateTimeImmutable'); + throw new InvalidArgumentException('$clock->now() must return a DateTimeImmutable'); } $wrappedClock = new class($clock) implements ClockInterface { @@ -39,13 +40,13 @@ final class WrappingClock implements Clock $this->clock = $clock; } - public function now(): \DateTimeImmutable + public function now(): DateTimeImmutable { assert(method_exists($this->clock, 'now')); $now = $this->clock->now(); - assert($now instanceof \DateTimeImmutable); + assert($now instanceof DateTimeImmutable); return $now; }