diff options
| author | 2025-01-08 13:26:09 +0100 | |
|---|---|---|
| committer | 2025-01-08 13:26:09 +0100 | |
| commit | 50adb559823f935582f3ed308b8d4352c5f216ed (patch) | |
| tree | 74f09efadfcaf28f82505e791e267596f4026053 /lib/Minz | |
| parent | fa701b39f3775ac4250a82fabcec8970b446789b (diff) | |
Add some missing PHP native types (#7191)
* Add some missing PHP native types
Replaces https://github.com/FreshRSS/FreshRSS/pull/7184
* Clean some types
Diffstat (limited to 'lib/Minz')
| -rw-r--r-- | lib/Minz/Error.php | 2 | ||||
| -rw-r--r-- | lib/Minz/Paginator.php | 8 | ||||
| -rw-r--r-- | lib/Minz/Request.php | 2 | ||||
| -rw-r--r-- | lib/Minz/View.php | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/lib/Minz/Error.php b/lib/Minz/Error.php index e95fd346c..e44ec8579 100644 --- a/lib/Minz/Error.php +++ b/lib/Minz/Error.php @@ -52,7 +52,7 @@ class Minz_Error { * @param string|array<'error'|'warning'|'notice',list<string>> $logs logs sorted by category (error, warning, notice) * @return list<string> list of matching logs, without the category, according to environment preferences (production / development) */ - private static function processLogs($logs): array { + private static function processLogs(string|array $logs): array { if (is_string($logs)) { return [$logs]; } diff --git a/lib/Minz/Paginator.php b/lib/Minz/Paginator.php index 7d6892c67..265b0c2cb 100644 --- a/lib/Minz/Paginator.php +++ b/lib/Minz/Paginator.php @@ -64,11 +64,11 @@ class Minz_Paginator { * @param Minz_Model $item l'élément à retrouver * @return int|false la page à laquelle se trouve l’élément, false si non trouvé */ - public function pageByItem($item): int|false { + public function pageByItem(Minz_Model $item): int|false { $i = 0; do { - if ($item == $this->items[$i]) { + if ($item === $this->items[$i]) { return (int)(ceil(($i + 1) / $this->nbItemsPerPage)); } $i++; @@ -82,11 +82,11 @@ class Minz_Paginator { * @param Minz_Model $item the element to search * @return int|false the position of the element, or false if not found */ - public function positionByItem($item): int|false { + public function positionByItem(Minz_Model $item): int|false { $i = 0; do { - if ($item == $this->items[$i]) { + if ($item === $this->items[$i]) { return $i; } $i++; diff --git a/lib/Minz/Request.php b/lib/Minz/Request.php index f441bcabf..3304ad480 100644 --- a/lib/Minz/Request.php +++ b/lib/Minz/Request.php @@ -432,7 +432,7 @@ class Minz_Request { * @param bool $redirect If true, uses an HTTP redirection, and if false (default), performs an internal dispatcher redirection. * @throws Minz_ConfigurationException */ - public static function forward($url = [], bool $redirect = false): void { + public static function forward(array $url = [], bool $redirect = false): void { if (empty(Minz_Request::originalRequest())) { self::$originalRequest = $url; } diff --git a/lib/Minz/View.php b/lib/Minz/View.php index 01e8501b0..65573c7bd 100644 --- a/lib/Minz/View.php +++ b/lib/Minz/View.php @@ -247,7 +247,7 @@ class Minz_View { /** * @param string|array{dark?:string,light?:string,default?:string} $themeColors */ - public static function appendThemeColors($themeColors): void { + public static function appendThemeColors(string|array $themeColors): void { self::$themeColors = $themeColors; } |
