FixedClock
A reproducible clock: always returns the instant it was constructed with. The determinism a replay needs.
FixedClock::__construct()
public function __construct(string $instant):Parameters
| Name | Type | Description |
|---|---|---|
| $instant | string |
FixedClock::now()
public function now(): stringThe fixed instant this clock was constructed with.
FixedClock::instant()
public function instant(): DateTimeImmutableThe same fixed instant as a {@see \DateTimeImmutable} — derived from the very string {@see now()} returns, so a consumer that compares/formats replays byte-identical: {@see instant()}->format('c') === {@see now()}.