Centum\Clock
The Clock component provides a consistent way to determine the current time in your application. It is especially useful for testing, scheduling, and anywhere you need to reference or control time.
Clocks implement Centum\Interfaces\Clock\ClockInterface
.
Clocks require two public methods:
now(): DateTimeImmutable
sleep(int $seconds): void
Available Implementations
Centum\Clock\SystemClock
: Useful for production.Centum\Clock\MockClock
: Useful for testing.