Skip to content

Commit 5bbee25

Browse files
committed
feature #47730 Ban DateTime from the codebase (WebMamba)
This PR was squashed before being merged into the 6.2 branch. Discussion ---------- Ban DateTime from the codebase | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | yes | Deprecations? | yes | Tickets | #47580 | License | MIT | Doc PR | symfony As discuss in this issue, the purpose of this PR is to remove DateTime from the code base in favor to DateTimeImmutable. I will process it component by component. Feel free to discuss! Commits ------- 689385a83f Ban DateTime from the codebase
2 parents 73abf45 + af29a6b commit 5bbee25

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

BufferingLogger.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function __destruct()
5353
if (null === $val || \is_scalar($val) || (\is_object($val) && \is_callable([$val, '__toString']))) {
5454
$message = str_replace("{{$key}}", $val, $message);
5555
} elseif ($val instanceof \DateTimeInterface) {
56-
$message = str_replace("{{$key}}", $val->format(\DateTime::RFC3339), $message);
56+
$message = str_replace("{{$key}}", $val->format(\DateTimeInterface::RFC3339), $message);
5757
} elseif (\is_object($val)) {
5858
$message = str_replace("{{$key}}", '[object '.get_debug_type($val).']', $message);
5959
} else {
@@ -62,7 +62,7 @@ public function __destruct()
6262
}
6363
}
6464

65-
error_log(sprintf('%s [%s] %s', date(\DateTime::RFC3339), $level, $message));
65+
error_log(sprintf('%s [%s] %s', date(\DateTimeInterface::RFC3339), $level, $message));
6666
}
6767
}
6868
}

0 commit comments

Comments
 (0)