Skip to content
docsv0.12.0

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

Parameters of __construct()
NameTypeDescription
$instantstring

FixedClock::now()

public function now(): string

The fixed instant this clock was constructed with.

FixedClock::instant()

public function instant(): DateTimeImmutable

The 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()}.