don't rely on 'args' in trace, not available in 7.4

This commit is contained in:
Remi Collet
2020-02-12 13:46:34 +01:00
parent 50e77ace68
commit e8384e45fa
2 changed files with 22 additions and 16 deletions
+10 -10
View File
@@ -102,16 +102,16 @@ final class InvalidTag implements Tag
};
do {
$trace = array_map(
static function (array $call) use ($flatten) : array {
$call['args'] = $call['args'] ?? [];
array_walk_recursive($call['args'], $flatten);
return $call;
},
$exception->getTrace()
);
$trace = $exception->getTrace();
if (isset($trace[0]['args'])) {
$trace = array_map(
static function (array $call) use ($flatten) : array {
array_walk_recursive($call['args'], $flatten);
return $call;
},
$trace
);
}
$traceProperty->setValue($exception, $trace);
$exception = $exception->getPrevious();
} while ($exception !== null);