1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-24 18:16:10 +02:00

Merge branch '2.x'

This commit is contained in:
Jordi Boggiano
2023-10-27 15:24:31 +02:00
4 changed files with 25 additions and 5 deletions

View File

@@ -206,6 +206,9 @@ class NormalizerFormatter implements FormatterInterface
if ($data instanceof \JsonSerializable) {
/** @var null|scalar|array<mixed[]|scalar|null> $value */
$value = $data->jsonSerialize();
} elseif (\get_class($data) === '__PHP_Incomplete_Class') {
$accessor = new \ArrayObject($data);
$value = (string) $accessor['__PHP_Incomplete_Class_Name'];
} elseif (method_exists($data, '__toString')) {
/** @var string $value */
$value = $data->__toString();