From 90199507e3b3bc692f02da2850c57fa5976fd1f9 Mon Sep 17 00:00:00 2001 From: erikn69 Date: Thu, 27 Mar 2025 11:47:48 -0500 Subject: [PATCH 1/2] Use `addWarning` on warnings, silenced errors, notices --- src/LaravelDebugbar.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/LaravelDebugbar.php b/src/LaravelDebugbar.php index 5ca7e317..d4f15ba0 100644 --- a/src/LaravelDebugbar.php +++ b/src/LaravelDebugbar.php @@ -656,7 +656,10 @@ public function addCollector(DataCollectorInterface $collector) */ public function handleError($level, $message, $file = '', $line = 0, $context = []) { - $this->addThrowable(new \ErrorException($message, 0, $level, $file, $line)); + if ($this->hasCollector('exceptions')) { + $this->getCollector('exceptions')->addWarning($level, $message, $file, $line); + } + if ($this->hasCollector('messages')) { $file = $file ? ' on ' . $this['messages']->normalizeFilePath($file) . ":{$line}" : ''; $this['messages']->addMessage($message . $file, 'deprecation'); From 7bb4212eadb7c4f7a6d09d2954bc1375b43b7578 Mon Sep 17 00:00:00 2001 From: erikn69 Date: Tue, 22 Apr 2025 12:31:08 -0500 Subject: [PATCH 2/2] shorter --- src/LaravelDebugbar.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LaravelDebugbar.php b/src/LaravelDebugbar.php index d4f15ba0..027303ab 100644 --- a/src/LaravelDebugbar.php +++ b/src/LaravelDebugbar.php @@ -657,7 +657,7 @@ public function addCollector(DataCollectorInterface $collector) public function handleError($level, $message, $file = '', $line = 0, $context = []) { if ($this->hasCollector('exceptions')) { - $this->getCollector('exceptions')->addWarning($level, $message, $file, $line); + $this['exceptions']->addWarning($level, $message, $file, $line); } if ($this->hasCollector('messages')) {