mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-02 11:20:31 +02:00
Handle detail key of SoapFault being an object, fixes #1391
This commit is contained in:
@@ -142,8 +142,8 @@ class NormalizerFormatter implements FormatterInterface
|
|||||||
$data['faultactor'] = $e->faultactor;
|
$data['faultactor'] = $e->faultactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($e->detail)) {
|
if (isset($e->detail) && (is_string($e->detail) || is_object($e->detail) || is_array($e->detail))) {
|
||||||
$data['detail'] = $e->detail;
|
$data['detail'] = is_string($e->detail) ? $e->detail : reset($e->detail);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -92,7 +92,7 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
$formatter = new NormalizerFormatter('Y-m-d');
|
$formatter = new NormalizerFormatter('Y-m-d');
|
||||||
$e = new \SoapFault('foo', 'bar', 'hello', 'world');
|
$e = new \SoapFault('foo', 'bar', 'hello', (object) ['foo' => 'world']);
|
||||||
$formatted = $formatter->format(array(
|
$formatted = $formatter->format(array(
|
||||||
'exception' => $e,
|
'exception' => $e,
|
||||||
));
|
));
|
||||||
|
Reference in New Issue
Block a user