8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2c72817 commit a74086dCopy full SHA for a74086d
Resources/now.php
@@ -11,13 +11,15 @@
11
12
namespace Symfony\Component\Clock;
13
14
-/**
15
- * Returns the current time as a DateTimeImmutable.
16
- *
17
- * Note that you should prefer injecting a ClockInterface or using
18
- * ClockAwareTrait when possible instead of using this function.
19
- */
20
-function now(): \DateTimeImmutable
21
-{
22
- return Clock::get()->now();
+if (!\function_exists(now::class)) {
+ /**
+ * Returns the current time as a DateTimeImmutable.
+ *
+ * Note that you should prefer injecting a ClockInterface or using
+ * ClockAwareTrait when possible instead of using this function.
+ */
+ function now(): \DateTimeImmutable
+ {
23
+ return Clock::get()->now();
24
+ }
25
}
0 commit comments