final | |
---|---|
implements |
Clock |
A reference to the internal clock. This is primarily useful for mocking the clock in tests.
Classes should not use this class directly, but instead
use the Clock
interface or the two traits ClockAware
and ImmutableClockAware
.
Methods | ||
---|---|---|
public
|
__construct(?Clock $innerClock = null, ?DateTimeZone $timezone = null)
|
# |
public
static
|
getCurrent(): Clock
|
# |
public
static
|
set(?Clock $clock): void
|
# |
public
|
now(): DateTimeImmutable
|
# |
public
|
sleep(float|int $seconds): void
|
# |