Skip to content

Commit

Permalink
Remove trace args in Exceptions (#691)
Browse files Browse the repository at this point in the history
* Remove trace args in Exceptions

* Always cleanup args
  • Loading branch information
barryvdh authored Oct 29, 2024
1 parent 689720d commit 6874000
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/DebugBar/DataCollector/ExceptionsCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,22 @@ public function formatTrace(array $trace)
if (isset($track['file'])) {
$track['file'] = $this->normalizeFilePath($track['file']);
}

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;
}

Expand Down

0 comments on commit 6874000

Please sign in to comment.