Skip to content

Commit 6ee3f31

Browse files
committed
Switch back to stella-maris/clock
This reverts commit a5e62af.
1 parent 2ba952c commit 6ee3f31

7 files changed

Lines changed: 11 additions & 12 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
],
1313
"require": {
1414
"php": "^8.0",
15-
"psr/clock": "^1.0"
15+
"stella-maris/clock": "^0.1.6"
1616
},
1717
"require-dev": {
1818
"phpstan/extension-installer": "^1.2",

src/Clock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Beste;
66

7-
use Psr\Clock\ClockInterface;
7+
use StellaMaris\Clock\ClockInterface;
88

99
interface Clock extends ClockInterface
1010
{

src/Clock/FrozenClock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Beste\Clock;
88
use DateTimeImmutable;
99
use DateTimeZone;
10-
use Psr\Clock\ClockInterface;
10+
use StellaMaris\Clock\ClockInterface;
1111

1212
final class FrozenClock implements Clock
1313
{

src/Clock/MinuteClock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use Beste\Clock;
88
use DateTimeImmutable;
9-
use Psr\Clock\ClockInterface;
9+
use StellaMaris\Clock\ClockInterface;
1010

1111
final class MinuteClock implements Clock
1212
{

src/Clock/WrappingClock.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66

77
use Beste\Clock;
88
use DateTimeImmutable;
9-
use InvalidArgumentException;
10-
use Psr\Clock\ClockInterface;
9+
use StellaMaris\Clock\ClockInterface;
1110

1211
final class WrappingClock implements Clock
1312
{
@@ -25,11 +24,11 @@ public static function wrapping(object $clock): self
2524
}
2625

2726
if (!method_exists($clock, 'now')) {
28-
throw new InvalidArgumentException('$clock must implement '.ClockInterface::class.' or have a now() method');
27+
throw new \InvalidArgumentException('$clock must implement StellaMaris\Clock\ClockInterface or have a now() method');
2928
}
3029

3130
if (!($clock->now() instanceof DateTimeImmutable)) {
32-
throw new InvalidArgumentException('$clock->now() must return a DateTimeImmutable');
31+
throw new \InvalidArgumentException('$clock->now() must return a DateTimeImmutable');
3332
}
3433

3534
$wrappedClock = new class($clock) implements ClockInterface {
@@ -40,13 +39,13 @@ public function __construct(object $clock)
4039
$this->clock = $clock;
4140
}
4241

43-
public function now(): DateTimeImmutable
42+
public function now(): \DateTimeImmutable
4443
{
4544
assert(method_exists($this->clock, 'now'));
4645

4746
$now = $this->clock->now();
4847

49-
assert($now instanceof DateTimeImmutable);
48+
assert($now instanceof \DateTimeImmutable);
5049

5150
return $now;
5251
}

tests/Clock/FrozenClockTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Beste\Clock\FrozenClock;
88
use DateTimeImmutable;
99
use PHPUnit\Framework\TestCase;
10-
use Psr\Clock\ClockInterface;
10+
use StellaMaris\Clock\ClockInterface;
1111

1212
/**
1313
* @internal

tests/Clock/MinuteClockTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Beste\Clock\MinuteClock;
88
use DateTimeImmutable;
99
use PHPUnit\Framework\TestCase;
10-
use Psr\Clock\ClockInterface;
10+
use StellaMaris\Clock\ClockInterface;
1111

1212
/**
1313
* @internal

0 commit comments

Comments
 (0)