1
0
mirror of https://github.com/danog/amp.git synced 2024-11-30 04:29:08 +01:00

Update backtrace formatting

This commit is contained in:
Aaron Piotrowski 2017-12-02 10:03:38 -06:00
parent 745a95ba67
commit e3b0b9a0c7
No known key found for this signature in database
GPG Key ID: ADD1EF783EDE9EEB

View File

@ -14,7 +14,11 @@ namespace Amp\Internal;
*/
function formatStacktrace(array $trace): string {
return \implode("\n", \array_map(function ($e, $i) {
$line = "#{$i} {$e['file']}:{$e['line']} ";
$line = "#{$i} ";
if (isset($e["file"])) {
$line .= "{$e['file']}:{$e['line']} ";
}
if ($e["type"]) {
$line .= $e["class"] . $e["type"];