1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-09-06 19:21:08 +02:00

Fix SoapFault when detail is nested object, fixes #1431, refs #1462

This commit is contained in:
Jordi Boggiano
2020-05-21 16:39:23 +02:00
parent 74f92ea154
commit acd3173c4a
2 changed files with 27 additions and 3 deletions

View File

@@ -142,8 +142,12 @@ class NormalizerFormatter implements FormatterInterface
$data['faultactor'] = $e->faultactor;
}
if (isset($e->detail) && (is_string($e->detail) || is_object($e->detail) || is_array($e->detail))) {
$data['detail'] = is_string($e->detail) ? $e->detail : reset($e->detail);
if (isset($e->detail)) {
if (is_string($e->detail)) {
$data['detail'] = $e->detail;
} elseif (is_object($e->detail) || is_array($e->detail)) {
$data['detail'] = $this->toJson($e->detail, true);
}
}
}