From 08defbd046663fdc0bb42fe1a44040ef35be16d9 Mon Sep 17 00:00:00 2001 From: "origami11@yandex.ru" Date: Thu, 4 Dec 2025 16:39:24 +0300 Subject: [PATCH] =?UTF-8?q?chore:=20=D0=A2=D0=B8=D0=BF=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Connection/HttpResponse.php | 2 +- src/Controller/Component.php | 2 +- src/Controller/Front.php | 2 +- src/Database.php | 6 ++++++ src/Filter/Login.php | 6 +++--- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/Connection/HttpResponse.php b/src/Connection/HttpResponse.php index 9f0fe69..a16120b 100644 --- a/src/Connection/HttpResponse.php +++ b/src/Connection/HttpResponse.php @@ -47,7 +47,7 @@ class HttpResponse if (isset($this->param['Transfer-Encoding']) && $this->param['Transfer-Encoding'] == 'chunked') { //$this->data = substr($this->response, $this->offset); - $index = hexdec($this->getLine()); + $index = (int)hexdec($this->getLine()); $chunk = []; while ($index > 0) { $chunk [] = substr($this->response, $this->offset, $index); diff --git a/src/Controller/Component.php b/src/Controller/Component.php index fbf04b7..124d4e5 100644 --- a/src/Controller/Component.php +++ b/src/Controller/Component.php @@ -135,7 +135,7 @@ class Component foreach ($this->viewPath as $index => $viewPath) { // Загружать шаблон по умолчанию если не найден текущий $dir = Path::join($this->viewPath[$index], 'templates', $template); - if(is_dir($dir)) { + if (is_dir($dir)) { $tpl = new PHPTAL(Path::join($this->viewPath[$index], 'templates', $template, $name)); $tpl->setPhpCodeDestination(PHPTAL_PHP_CODE_DESTINATION); $selected = $index; diff --git a/src/Controller/Front.php b/src/Controller/Front.php index 1a64a65..b799f40 100644 --- a/src/Controller/Front.php +++ b/src/Controller/Front.php @@ -111,7 +111,7 @@ class Front extends Action public function execute(HttpRequest $request) { - $name = $request->get('module', $this->default); + $name = $request->getString('module', $this->default); try { return $this->loadModule($name, $request); } catch (UserMessageException $ex) { //Исключение с понятным пользователю сообщением diff --git a/src/Database.php b/src/Database.php index a15b787..ab2a233 100644 --- a/src/Database.php +++ b/src/Database.php @@ -53,6 +53,12 @@ namespace ctiso { return $result; } + function query($query, $fetchMode = PDO::FETCH_INTO, mixed $_arg1 = null, mixed $_arg2 = null): PDOStatement { + /** @var PDOStatement */ + $result = parent::query($query, $fetchMode); + return $result; + } + /** * Возвращает DSN * @return DSN diff --git a/src/Filter/Login.php b/src/Filter/Login.php index 93df732..2df43b7 100644 --- a/src/Filter/Login.php +++ b/src/Filter/Login.php @@ -41,7 +41,7 @@ class Login extends Filter /** * Проверка авторизации * @param HttpRequest $request - * @return Boolean Авторизовани пользователь или нет + * @return bool Авторизовани пользователь или нет */ public function isLoggin(HttpRequest $request) { @@ -50,8 +50,8 @@ class Login extends Filter switch ($request->getAction()) { // Авторизация по постоянному паролю case 'login': - $login = $request->get('login', '') ; - $password = $request->get('password'); + $login = $request->getString('login', '') ; + $password = $request->getString('password'); $result = $this->role->getUserByLogin($login); // Поиск по логину if ($result) {