Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e804806 commit 6b88ea7Copy full SHA for 6b88ea7
src/Symfony/Component/Clock/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