diff --git a/src/Clock/Clock.php b/src/Clock/Clock.php new file mode 100644 index 0000000..9d2bfd3 --- /dev/null +++ b/src/Clock/Clock.php @@ -0,0 +1,12 @@ +moment = $moment ?? Moment::fromDateTime(new \DateTimeImmutable('now')); + } + + public function freeze(Moment $moment): void + { + $this->moment = $moment; + } + + #[\Override] + public function now(): Moment + { + return $this->moment; + } +} diff --git a/src/Clock/SystemClock.php b/src/Clock/SystemClock.php new file mode 100644 index 0000000..4c23117 --- /dev/null +++ b/src/Clock/SystemClock.php @@ -0,0 +1,19 @@ +