Skip to content

Commit

Permalink
bug #49027 [Clock] Make ClockAwareTrait use the global clock by defau…
Browse files Browse the repository at this point in the history
…lt (nicolas-grekas)

This PR was merged into the 6.3 branch.

Discussion
----------

[Clock] Make ClockAwareTrait use the global clock by default

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Let's make `ClockAwareTrait` compatible with `Clock::now()` from #48642 by default.

Commits
-------

ec60013 [Clock] Make ClockAwareTrait use the global clock by default
  • Loading branch information
nicolas-grekas committed Jan 19, 2023
2 parents 1f7bc10 + ec60013 commit f3c1ef1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Component/Clock/ClockAwareTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ public function setClock(ClockInterface $clock): void

protected function now(): \DateTimeImmutable
{
return ($this->clock ??= new NativeClock())->now();
return ($this->clock ??= new Clock())->now();
}
}

0 comments on commit f3c1ef1

Please sign in to comment.