Aliases
Alias mapping
ClockServiceProvider
contributes the following alias map:
| Requested service | Target service |
|---|---|
Psr\Clock\ClockInterface
|
FastForward\Clock\SystemClock
|
Operational consequences
- resolving the PSR interface gives the
SystemClockinstance; - resolving the concrete
SystemClockgives that same instance; - replacing
SystemClockin an earlier provider overrides the default cleanly.
Recommended override strategy
When you want deterministic time in tests:
- register a provider that exposes your
FrozenClock; - alias
Psr\Clock\ClockInterfaceto your frozen clock; - pass that provider before
ClockServiceProvidertocontainer().