Skip to content

Commit 93c1a57

Browse files
committed
bug #48870 [Clock] Fix unitialized variable (fabpot)
This PR was merged into the 6.3 branch. Discussion ---------- [Clock] Fix unitialized variable | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | n/a Commits ------- 2df462301c [Clock] Fix unitialized variable
2 parents a391557 + 810089c commit 93c1a57

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)