1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-01-16 13:00:42 +01:00

Always cleanup args

This commit is contained in:
Barry vd. Heuvel 2024-10-29 13:08:34 +01:00 committed by GitHub
parent 6c17e0ea44
commit bbbcd6335b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -97,19 +97,22 @@ class ExceptionsCollector extends DataCollector implements Renderable
if (isset($track['file'])) {
$track['file'] = $this->normalizeFilePath($track['file']);
}
if (isset($track['args'])) {
foreach ($track['args'] as $key => $arg) {
if (is_object($arg)) {
$track['args'][$key] = '[object ' . $this->getDataFormatter()->formatClassName($arg) . ']';
}
}
}
return $track;
}, $trace);
}
// Remove large objects from the trace
$trace = array_map(function ($track) {
if (isset($track['args'])) {
foreach ($track['args'] as $key => $arg) {
if (is_object($arg)) {
$track['args'][$key] = '[object ' . $this->getDataFormatter()->formatClassName($arg) . ']';
}
}
}
return $track;
}, $trace);
return $trace;
}