From d10f5f37bcf5c18fbb12b67d88a5232fa1d54a38 Mon Sep 17 00:00:00 2001 From: David Grudl <david@grudl.com> Date: Mon, 29 Apr 2024 12:20:21 +0200 Subject: [PATCH] bar: errors panel => warnings --- .../Bar/panels/{errors.panel.phtml => warnings.panel.phtml} | 0 src/Tracy/Bar/panels/{errors.tab.phtml => warnings.tab.phtml} | 4 ++-- src/Tracy/Debugger/Debugger.php | 2 +- src/Tracy/Debugger/DevelopmentStrategy.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename src/Tracy/Bar/panels/{errors.panel.phtml => warnings.panel.phtml} (100%) rename src/Tracy/Bar/panels/{errors.tab.phtml => warnings.tab.phtml} (92%) diff --git a/src/Tracy/Bar/panels/errors.panel.phtml b/src/Tracy/Bar/panels/warnings.panel.phtml similarity index 100% rename from src/Tracy/Bar/panels/errors.panel.phtml rename to src/Tracy/Bar/panels/warnings.panel.phtml diff --git a/src/Tracy/Bar/panels/errors.tab.phtml b/src/Tracy/Bar/panels/warnings.tab.phtml similarity index 92% rename from src/Tracy/Bar/panels/errors.tab.phtml rename to src/Tracy/Bar/panels/warnings.tab.phtml index 70b0a53ed..baef3e1cf 100644 --- a/src/Tracy/Bar/panels/errors.tab.phtml +++ b/src/Tracy/Bar/panels/warnings.tab.phtml @@ -10,7 +10,7 @@ if (empty($data)) { } ?> <style class="tracy-debug"> - #tracy-debug .tracy-ErrorTab { + #tracy-debug .tracy-WarningsTab { display: block; background: #D51616; color: white; @@ -19,7 +19,7 @@ if (empty($data)) { padding: 1px .4em; } </style> -<span class="tracy-ErrorTab"> +<span class="tracy-WarningsTab"> <svg viewBox="0 0 2048 2048"><path fill="#fff" d="M1152 1503v-190q0-14-9.5-23.5t-22.5-9.5h-192q-13 0-22.5 9.5t-9.5 23.5v190q0 14 9.5 23.5t22.5 9.5h192q13 0 22.5-9.5t9.5-23.5zm-2-374l18-459q0-12-10-19-13-11-24-11h-220q-11 0-24 11-10 7-10 21l17 457q0 10 10 16.5t24 6.5h185q14 0 23.5-6.5t10.5-16.5zm-14-934l768 1408q35 63-2 126-17 29-46.5 46t-63.5 17h-1536q-34 0-63.5-17t-46.5-46q-37-63-2-126l768-1408q17-31 47-49t65-18 65 18 47 49z"/> </svg><span class="tracy-label"><?= $sum = array_sum($data), $sum > 1 ? ' warnings' : ' warning' ?></span> </span> diff --git a/src/Tracy/Debugger/Debugger.php b/src/Tracy/Debugger/Debugger.php index 2af031e6e..c6591361e 100644 --- a/src/Tracy/Debugger/Debugger.php +++ b/src/Tracy/Debugger/Debugger.php @@ -408,7 +408,7 @@ public static function getBar(): Bar self::$bar = new Bar; self::$bar->addPanel($info = new DefaultBarPanel('info'), 'Tracy:info'); $info->cpuUsage = self::$cpuUsage; - self::$bar->addPanel(new DefaultBarPanel('errors'), 'Tracy:errors'); // filled by errorHandler() + self::$bar->addPanel(new DefaultBarPanel('warnings'), 'Tracy:warnings'); // filled by errorHandler() } return self::$bar; diff --git a/src/Tracy/Debugger/DevelopmentStrategy.php b/src/Tracy/Debugger/DevelopmentStrategy.php index e53cb791d..ef53aef07 100644 --- a/src/Tracy/Debugger/DevelopmentStrategy.php +++ b/src/Tracy/Debugger/DevelopmentStrategy.php @@ -90,7 +90,7 @@ public function handleError( } $message = Helpers::errorTypeToString($severity) . ': ' . Helpers::improveError($message); - $count = &$this->bar->getPanel('Tracy:errors')->data["$file|$line|$message"]; + $count = &$this->bar->getPanel('Tracy:warnings')->data["$file|$line|$message"]; if (!$count++ && !Helpers::isHtmlMode() && !Helpers::isAjax()) { echo "\n$message in $file on line $line\n";