Skip to content

Commit 810089c

Browse files
committed
[Clock] Fix unitialized variable
1 parent 3b8186e commit 810089c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Clock.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ public static function set(PsrClockInterface $clock): void
4646

4747
public function now(): \DateTimeImmutable
4848
{
49-
$now = ($this->clock ?? self::$globalClock)->now();
49+
$now = ($this->clock ?? self::get())->now();
5050

5151
return isset($this->timezone) ? $now->setTimezone($this->timezone) : $now;
5252
}
5353

5454
public function sleep(float|int $seconds): void
5555
{
56-
$clock = $this->clock ?? self::$globalClock;
56+
$clock = $this->clock ?? self::get();
5757

5858
if ($clock instanceof ClockInterface) {
5959
$clock->sleep($seconds);

0 commit comments

Comments
 (0)