1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-22 00:56:08 +02:00

Deprecate DateTimeImmutable (#1928)

Fixes #1926
This commit is contained in:
Ruud Kamphuis
2024-12-05 15:38:02 +01:00
committed by GitHub
parent e940004193
commit a258e4fe90
12 changed files with 83 additions and 49 deletions

View File

@@ -60,7 +60,7 @@ class PsrLogMessageProcessor implements ProcessorInterface
if (null === $val || \is_scalar($val) || (\is_object($val) && method_exists($val, "__toString"))) {
$replacements[$placeholder] = $val;
} elseif ($val instanceof \DateTimeInterface) {
if (null === $this->dateFormat && $val instanceof \Monolog\DateTimeImmutable) {
if (null === $this->dateFormat && $val instanceof \Monolog\JsonSerializableDateTimeImmutable) {
// handle monolog dates using __toString if no specific dateFormat was asked for
// so that it follows the useMicroseconds flag
$replacements[$placeholder] = (string) $val;