File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff line change 44
55namespace Beste ;
66
7- use Psr \Clock \ClockInterface ;
7+ use StellaMaris \Clock \ClockInterface ;
88
99interface Clock extends ClockInterface
1010{
Original file line number Diff line number Diff line change 77use Beste \Clock ;
88use DateTimeImmutable ;
99use DateTimeZone ;
10- use Psr \Clock \ClockInterface ;
10+ use StellaMaris \Clock \ClockInterface ;
1111
1212final class FrozenClock implements Clock
1313{
Original file line number Diff line number Diff line change 66
77use Beste \Clock ;
88use DateTimeImmutable ;
9- use Psr \Clock \ClockInterface ;
9+ use StellaMaris \Clock \ClockInterface ;
1010
1111final class MinuteClock implements Clock
1212{
Original file line number Diff line number Diff line change 66
77use Beste \Clock ;
88use DateTimeImmutable ;
9- use InvalidArgumentException ;
10- use Psr \Clock \ClockInterface ;
9+ use StellaMaris \Clock \ClockInterface ;
1110
1211final 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 }
Original file line number Diff line number Diff line change 77use Beste \Clock \FrozenClock ;
88use DateTimeImmutable ;
99use PHPUnit \Framework \TestCase ;
10- use Psr \Clock \ClockInterface ;
10+ use StellaMaris \Clock \ClockInterface ;
1111
1212/**
1313 * @internal
Original file line number Diff line number Diff line change 77use Beste \Clock \MinuteClock ;
88use DateTimeImmutable ;
99use PHPUnit \Framework \TestCase ;
10- use Psr \Clock \ClockInterface ;
10+ use StellaMaris \Clock \ClockInterface ;
1111
1212/**
1313 * @internal
You can’t perform that action at this time.
0 commit comments