mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-22 09:06:10 +02:00
Fix fatal error in NormalizeFormatter: method_exists(): The script tried to execute a method or access a property of an incomplete object.
Closes #1833 Fixes #1834
This commit is contained in:
committed by
Jordi Boggiano
parent
70e1c2f405
commit
ed80d53ab2
@@ -174,6 +174,9 @@ class NormalizerFormatter implements FormatterInterface
|
||||
if ($data instanceof \JsonSerializable) {
|
||||
/** @var null|scalar|array<array|scalar|null> $value */
|
||||
$value = $data->jsonSerialize();
|
||||
} elseif (\get_class($data) === '__PHP_Incomplete_Class') {
|
||||
$accessor = new \ArrayObject($data);
|
||||
$value = $accessor['__PHP_Incomplete_Class_Name'];
|
||||
} elseif (method_exists($data, '__toString')) {
|
||||
/** @var string $value */
|
||||
$value = $data->__toString();
|
||||
|
||||
Reference in New Issue
Block a user