@@ -18,8 +18,9 @@ discard block |
||
| 18 | 18 | { |
| 19 | 19 | $should_display = ini_get('display_errors') == '1'; |
| 20 | 20 | |
| 21 | - if($should_display && !empty($error_message)) |
|
| 22 | - echo('<pre style="z-index:9999; background-color:#FFF; color:#000; padding:0.5em; font-size:0.7em; margin:0 0 1em 0; font-family:courier;">'.$error_message.'</pre>'); |
|
| 21 | + if($should_display && !empty($error_message)) { |
|
| 22 | + echo('<pre style="z-index:9999; background-color:#FFF; color:#000; padding:0.5em; font-size:0.7em; margin:0 0 1em 0; font-family:courier;">'.$error_message.'</pre>'); |
|
| 23 | + } |
|
| 23 | 24 | } |
| 24 | 25 | |
| 25 | 26 | // ----------------------------------------------------------- visual dump (depends on env) |
@@ -43,8 +44,7 @@ discard block |
||
| 43 | 44 | $backtrace = $var->getTrace(); |
| 44 | 45 | $full_backtrace = true; |
| 45 | 46 | $var_dump = self::format_throwable_message(get_class($var), $var->getCode(), $var->getFile(), $var->getLine(), $var->getMessage()); |
| 46 | - } |
|
| 47 | - else |
|
| 47 | + } else |
|
| 48 | 48 | { |
| 49 | 49 | $backtrace = debug_backtrace(); |
| 50 | 50 | |
@@ -80,21 +80,24 @@ discard block |
||
| 80 | 80 | $function_name = $trace['function'] ?? '?'; |
| 81 | 81 | $class_name = $trace['class'] ?? '?'; |
| 82 | 82 | |
| 83 | - if(self::is_debugger_function($class_name, $function_name)) |
|
| 84 | - continue; |
|
| 83 | + if(self::is_debugger_function($class_name, $function_name)) { |
|
| 84 | + continue; |
|
| 85 | + } |
|
| 85 | 86 | |
| 86 | - if(!self::is_debugger_call($function_name) && isset($trace['args'])) |
|
| 87 | - $args = self::trace_args_to_string($trace['args']); |
|
| 88 | - else |
|
| 89 | - $args = microtime(true); |
|
| 87 | + if(!self::is_debugger_call($function_name) && isset($trace['args'])) { |
|
| 88 | + $args = self::trace_args_to_string($trace['args']); |
|
| 89 | + } else { |
|
| 90 | + $args = microtime(true); |
|
| 91 | + } |
|
| 90 | 92 | |
| 91 | 93 | $call_file = isset($trace['file']) ? basename($trace['file']) : '?'; |
| 92 | 94 | $call_line = $trace['line'] ?? '?'; |
| 93 | 95 | |
| 94 | 96 | $formated_traces []= sprintf('[%-23.23s %3s] %'.($depth*3).'s%s%s(%s)', $call_file, $call_line,' ', "$class_name::", $function_name, $args); |
| 95 | 97 | |
| 96 | - if($full_backtrace === false) |
|
| 97 | - break; |
|
| 98 | + if($full_backtrace === false) { |
|
| 99 | + break; |
|
| 100 | + } |
|
| 98 | 101 | } |
| 99 | 102 | |
| 100 | 103 | return implode(PHP_EOL, array_reverse($formated_traces)); |