@@ -354,62 +354,52 @@ public function getTitle(): string
354354 */
355355 public function getBacktraceDisplay (): string
356356 {
357- return self ::formatBacktrace (
358- $ this ->getBacktrace (),
359- "<br> \n" ,
360- "<br> \n"
361- );
357+ return self ::formatBacktrace ($ this ->getBacktrace ());
362358 }
363359
364360 /**
365361 * return formatted backtrace field
366362 *
367- * @param array $backtrace Backtrace data
368- * @param string $separator Arguments separator to use
369- * @param string $lines Lines separator to use
363+ * @param array $backtrace Backtrace data
370364 *
371365 * @return string formatted backtrace
372366 */
373- public static function formatBacktrace (
374- array $ backtrace ,
375- string $ separator ,
376- string $ lines
377- ): string {
378- $ retval = '' ;
367+ public static function formatBacktrace (array $ backtrace ): string
368+ {
369+ $ retval = '<ol class="list-group"> ' ;
379370
380371 foreach ($ backtrace as $ step ) {
372+ $ retval .= '<li class="list-group-item"> ' ;
381373 if (isset ($ step ['file ' ], $ step ['line ' ])) {
382- $ retval .= self ::relPath ($ step ['file ' ])
383- . '# ' . $ step ['line ' ] . ': ' ;
374+ $ retval .= self ::relPath ($ step ['file ' ]) . '# ' . $ step ['line ' ] . ': ' ;
384375 }
385376
386377 if (isset ($ step ['class ' ])) {
387378 $ retval .= $ step ['class ' ] . $ step ['type ' ];
388379 }
389380
390- $ retval .= self ::getFunctionCall ($ step, $ separator );
391- $ retval .= $ lines ;
381+ $ retval .= self ::getFunctionCall ($ step );
382+ $ retval .= ' </li> ' ;
392383 }
393384
394- return $ retval ;
385+ return $ retval . ' </ol> ' ;
395386 }
396387
397388 /**
398389 * Formats function call in a backtrace
399390 *
400- * @param array $step backtrace step
401- * @param string $separator Arguments separator to use
391+ * @param array $step backtrace step
402392 */
403- public static function getFunctionCall (array $ step, string $ separator ): string
393+ public static function getFunctionCall (array $ step ): string
404394 {
405395 $ retval = $ step ['function ' ] . '( ' ;
406396 if (isset ($ step ['args ' ])) {
407397 if (count ($ step ['args ' ]) > 1 ) {
408- $ retval .= $ separator ;
398+ $ retval .= ' <br> ' ;
409399 foreach ($ step ['args ' ] as $ arg ) {
410400 $ retval .= "\t" ;
411401 $ retval .= $ arg ;
412- $ retval .= ', ' . $ separator ;
402+ $ retval .= ',<br> ' ;
413403 }
414404 } elseif (count ($ step ['args ' ]) > 0 ) {
415405 foreach ($ step ['args ' ] as $ arg ) {
@@ -481,12 +471,12 @@ public function getDisplay(): string
481471
482472 return $ template ->render ('error/get_display ' , [
483473 'context ' => $ context ,
484- 'isUserError ' => $ this ->isUserError (),
474+ 'is_user_error ' => $ this ->isUserError (),
485475 'type ' => $ this ->getType (),
486476 'file ' => $ this ->getFile (),
487477 'line ' => $ this ->getLine (),
488478 'message ' => $ this ->getMessage (),
489- 'backtraceDisplay ' => $ this ->getBacktraceDisplay (),
479+ 'formatted_backtrace ' => $ this ->getBacktraceDisplay (),
490480 ]);
491481 }
492482
0 commit comments