diff --git a/src/utils/ExceptionTraceCleaner.php b/src/utils/ExceptionTraceCleaner.php index 8e71b3a..feb8e6d 100644 --- a/src/utils/ExceptionTraceCleaner.php +++ b/src/utils/ExceptionTraceCleaner.php @@ -53,16 +53,12 @@ public function getTrace(int $start = 0, ?array $trace = null) : array{ for($i = $start; isset($trace[$i]); ++$i, ++$j){ $params = ""; if(isset($trace[$i]["args"]) or isset($trace[$i]["params"])){ - if(isset($trace[$i]["args"])){ - $args = $trace[$i]["args"]; - }else{ - $args = $trace[$i]["params"]; - } + $args = $trace[$i]["args"] ?? $trace[$i]["params"]; foreach($args as $name => $value){ $params .= (is_object($value) ? get_class($value) . " " . (method_exists($value, "__toString") ? $value->__toString() : "object") : gettype($value) . " " . @strval($value)) . ", "; } } - $messages[] = "#$j " . (isset($trace[$i]["file"]) ? $this->cleanPath($trace[$i]["file"]) : "") . "(" . (isset($trace[$i]["line"]) ? $trace[$i]["line"] : "") . "): " . (isset($trace[$i]["class"]) ? $trace[$i]["class"] . (($trace[$i]["type"] === "dynamic" or $trace[$i]["type"] === "->") ? "->" : "::") : "") . $trace[$i]["function"] . "(" . substr($params, 0, -2) . ")"; + $messages[] = "#$j " . (isset($trace[$i]["file"]) ? $this->cleanPath($trace[$i]["file"]) : "") . "(" . ($trace[$i]["line"] ?? "") . "): " . (isset($trace[$i]["class"]) ? $trace[$i]["class"] . (($trace[$i]["type"] === "dynamic" or $trace[$i]["type"] === "->") ? "->" : "::") : "") . $trace[$i]["function"] . "(" . substr($params, 0, -2) . ")"; } return $messages;