From d4ab706c17b86aa1a3122afbb6f001eea1b1eef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Ba=C5=84kowski?= Date: Mon, 11 Dec 2023 17:47:25 +0100 Subject: [PATCH] Refactored exception/error handlers. --- src/Ouzo/Core/ExceptionHandling/DebugExceptionHandler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ouzo/Core/ExceptionHandling/DebugExceptionHandler.php b/src/Ouzo/Core/ExceptionHandling/DebugExceptionHandler.php index 212299ff..b8bbdf3a 100644 --- a/src/Ouzo/Core/ExceptionHandling/DebugExceptionHandler.php +++ b/src/Ouzo/Core/ExceptionHandling/DebugExceptionHandler.php @@ -16,7 +16,7 @@ class DebugExceptionHandler extends ExceptionHandler { public function runDefaultHandler($exception): void { - if ($this->needPrettyHandler()) { + if ($this->isPrettyHandlerNeeded()) { $run = new Run(); $run->pushHandler(new PrettyPageHandler()); $run->pushHandler(new DebugErrorLogHandler()); @@ -26,7 +26,7 @@ public function runDefaultHandler($exception): void } } - private function needPrettyHandler(): bool + private function isPrettyHandlerNeeded(): bool { $isHtmlResponse = ResponseTypeResolve::resolve() === MediaType::TEXT_HTML; return $isHtmlResponse && !Uri::isAjax();