From 33e3fba1044fc70e5b5dc6695efcdbd4281ebf0a Mon Sep 17 00:00:00 2001 From: User Date: Wed, 11 Oct 2023 00:00:54 +0300 Subject: [PATCH] 20231010#6 --- src/App.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/App.php b/src/App.php index 3a67ca3..0826e1b 100644 --- a/src/App.php +++ b/src/App.php @@ -61,9 +61,7 @@ class App extends Main { $log = "Method ".$appHandler->className."/".$appHandler->methodName; } $this->syslogger()->log("handlers", "OK - ".$log); - /** - * 1. Если на этапе итерации уже получен ответ ResponseInterface - досрочно отдаем результат в эмиттер - */ + if($response instanceof ResponseInterface) { return $response; } @@ -71,14 +69,7 @@ class App extends Main { } } /** - * 2. Если итерации закончились и задан обьект Content им создаем результат для эмиттера - */ - if($this->template() && !empty($this->template()->getResponse())){ - $this->globals()->response()->getBody()->write($this->template()->getResponse()); - return$this->globals()->response(); - } - /** - * 3. Отдаем пустой результат если не определен шаблонизатор + * Отдаем пустой результат */ return $this->defaultPage(404); } @@ -99,7 +90,7 @@ class App extends Main { $this->syslogger()->error("Error: ".$error->getMessage()." : ".$error->getFile()." : ".$error->getLine()); } /** - * 4. Отдаем ошибку без шаблона + * Отдаем после ошибки */ return $this->defaultPage(501); }