diff --git a/src/TracyBlueScreenDebugger.php b/src/TracyBlueScreenDebugger.php index 68838c7..1fa048e 100644 --- a/src/TracyBlueScreenDebugger.php +++ b/src/TracyBlueScreenDebugger.php @@ -47,7 +47,7 @@ public static function setPanel(?QueryPanel $panel): void */ public static function render(?\Throwable $e): ?array { - if (!$e instanceof ORMException) { + if ($e === null) { return null; } if ($e instanceof DriverException) { @@ -58,9 +58,11 @@ public static function render(?\Throwable $e): ?array } elseif ($e instanceof MappingException) { $tab = 'MappingException'; $content = self::renderMapping($e); - } else { + } elseif ($e instanceof ORMException) { $tab = 'ORM error'; $content = '

' . htmlspecialchars($e->getMessage()) . '

'; + } else { + return null; } return [ @@ -322,7 +324,7 @@ private static function renderQueries(): string . '
' . number_format($event->getDelayTime(), 2, '.', '') . '' . ($isTransaction ? '
' : '') . '' - . '' + . '' . ($event->getDuration() === null ? '
Error with processing this query!
' : '') @@ -332,7 +334,7 @@ private static function renderQueries(): string : '' ) . ''; $timeBlocks[] = '' - . ((int) round($durationMs)) + . ((int) round((float) $durationMs)) . ''; if ($event->getDuration() !== null) { @@ -349,9 +351,7 @@ private static function renderQueries(): string . ($other > 0 ? $other . '×other' : '') ); $return .= ']

'; - if ($timeBlocks !== []) { - $return .= '' . implode('', $timeBlocks) . '
'; - } + $return .= '' . implode('', $timeBlocks) . '
'; return sprintf(' %s