{ } /**
* Returns the current global clock.
*
* Note that you should prefer injecting a ClockInterface or using
* ClockAwareTrait when possible instead of using this method.
*/
public static function get(): ClockInterface
{ return self::
$globalClock ??=
new NativeClock();
} public static function set(PsrClockInterface
$clock): void
{ self::
$globalClock =
$clock instanceof ClockInterface ?
$clock :
new self($clock);
} public function now(): DatePoint
{ $now =
($this->clock ?? self::
get())->
now();