diff --git a/composer.json b/composer.json index 7ad8c0c..67268c1 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ ], "require": { "php": "~8.1.0 || ~8.2.0", - "stella-maris/clock": "^0.1.6" + "psr/clock": "^1.0" }, "require-dev": { "phpstan/extension-installer": "^1.2", diff --git a/src/Clock.php b/src/Clock.php index 02d9f71..5693d1d 100644 --- a/src/Clock.php +++ b/src/Clock.php @@ -4,7 +4,7 @@ namespace Beste; -use StellaMaris\Clock\ClockInterface; +use Psr\Clock\ClockInterface; interface Clock extends ClockInterface { diff --git a/src/Clock/FrozenClock.php b/src/Clock/FrozenClock.php index f2bf651..40f2895 100644 --- a/src/Clock/FrozenClock.php +++ b/src/Clock/FrozenClock.php @@ -7,7 +7,7 @@ use Beste\Clock; use DateTimeImmutable; use DateTimeZone; -use StellaMaris\Clock\ClockInterface; +use Psr\Clock\ClockInterface; final class FrozenClock implements Clock { diff --git a/src/Clock/MinuteClock.php b/src/Clock/MinuteClock.php index a7b5a31..309545f 100644 --- a/src/Clock/MinuteClock.php +++ b/src/Clock/MinuteClock.php @@ -6,7 +6,7 @@ use Beste\Clock; use DateTimeImmutable; -use StellaMaris\Clock\ClockInterface; +use Psr\Clock\ClockInterface; final class MinuteClock implements Clock { diff --git a/src/Clock/WrappingClock.php b/src/Clock/WrappingClock.php index 5919590..80b1fd5 100644 --- a/src/Clock/WrappingClock.php +++ b/src/Clock/WrappingClock.php @@ -6,7 +6,8 @@ use Beste\Clock; use DateTimeImmutable; -use StellaMaris\Clock\ClockInterface; +use InvalidArgumentException; +use Psr\Clock\ClockInterface; final class WrappingClock implements Clock { @@ -24,11 +25,11 @@ public static function wrapping(object $clock): self } 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 '.ClockInterface::class.' 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 @@ public function __construct(object $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; } diff --git a/tests/Clock/FrozenClockTest.php b/tests/Clock/FrozenClockTest.php index af24b1a..42d5be8 100644 --- a/tests/Clock/FrozenClockTest.php +++ b/tests/Clock/FrozenClockTest.php @@ -7,7 +7,7 @@ use Beste\Clock\FrozenClock; use DateTimeImmutable; use PHPUnit\Framework\TestCase; -use StellaMaris\Clock\ClockInterface; +use Psr\Clock\ClockInterface; /** * @internal diff --git a/tests/Clock/MinuteClockTest.php b/tests/Clock/MinuteClockTest.php index baf55fb..729c0ac 100644 --- a/tests/Clock/MinuteClockTest.php +++ b/tests/Clock/MinuteClockTest.php @@ -7,7 +7,7 @@ use Beste\Clock\MinuteClock; use DateTimeImmutable; use PHPUnit\Framework\TestCase; -use StellaMaris\Clock\ClockInterface; +use Psr\Clock\ClockInterface; /** * @internal