From fbe5eb878e7de494ade163feaf02659db40c28a5 Mon Sep 17 00:00:00 2001 From: "origami11@yandex.ru" Date: Tue, 9 Dec 2025 17:05:00 +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/Filter/Login.php | 7 +++++-- src/Form/Select.php | 2 +- src/Functions.php | 4 ++-- src/Validator/Validator.php | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Filter/Login.php b/src/Filter/Login.php index 78ac4b1..50475ee 100644 --- a/src/Filter/Login.php +++ b/src/Filter/Login.php @@ -187,8 +187,11 @@ class Login extends Filter } } else if (isset($_SERVER['HTTP_REFERER'])) { $arr = []; - parse_str(parse_url($_SERVER['HTTP_REFERER'] ?? '', PHP_URL_QUERY) ?? '', $arr); - if (isset($arr['back_page']) && $request->getString('mode') != 'ajax') { + parse_str(parse_url($_SERVER['HTTP_REFERER'] ?? '', PHP_URL_QUERY) ?: '', $arr); + if (isset($arr['back_page']) + && is_string($arr['back_page']) + && $request->getString('mode') != 'ajax') + { $request->redirect($arr['back_page']); } } diff --git a/src/Form/Select.php b/src/Form/Select.php index 333691a..89ea70d 100644 --- a/src/Form/Select.php +++ b/src/Form/Select.php @@ -4,7 +4,7 @@ namespace ctiso\Form; use ctiso\Form\Field; /** - * @phpstan-type Option = array{value: string, name: string, selected: bool, class?: string|false} + * @phpstan-type Option = array{value: string, name: string, selected?: bool, class?: string|false} */ class Select extends Field { diff --git a/src/Functions.php b/src/Functions.php index 1d7dd87..fa4391b 100644 --- a/src/Functions.php +++ b/src/Functions.php @@ -268,7 +268,7 @@ class Functions { /** * @param string $key - * @param list|\ArrayIterator $array + * @param array|\ArrayIterator $array * @return array */ static function key_values_object($key, $array) { @@ -283,7 +283,7 @@ class Functions { /** * @param string $key * @param string $value - * @param list>|\ArrayIterator $array + * @param array>|\ArrayIterator $array * @return array */ static function assoc_key_values($key, $value, $array) { diff --git a/src/Validator/Validator.php b/src/Validator/Validator.php index 7576ca8..2404d6a 100644 --- a/src/Validator/Validator.php +++ b/src/Validator/Validator.php @@ -10,7 +10,7 @@ use Exception, /** * @phpstan-type Rule array{ - * validate:string, // Описание правила см. формат правила ниже + * validate?:string, // Описание правила см. формат правила ниже * name:string, // Имя переменой для проверки * context?:object * }