From 1335a0e3cf11a0d4248e9eaaf748b89e6df741ef Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 4 Jan 2022 13:59:09 +0100 Subject: PHPStan level 5 (#4110) * Fix most PHPDocs errors Contributes to https://github.com/FreshRSS/FreshRSS/issues/4103 https://phpstan.org/writing-php-code/phpdoc-types * Avoid func_get_args Use variadic syntax instead https://php.net/manual/functions.arguments#functions.variable-arg-list And avoid dynamic functions names when possible to more easily identify calls and unused functions. Contributes to https://github.com/FreshRSS/FreshRSS/issues/4103 * PHPStan level 3 * PHPStand level 4 * Update default to PHPStan level 4 * Towards level 5 * Fix level 4 regression * Towards level 5 * Pass PHPStan level 5 * Towards level 6 * Remove erronenous regression from changelog https://github.com/FreshRSS/FreshRSS/pull/4116 --- lib/Minz/Request.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/Minz/Request.php') diff --git a/lib/Minz/Request.php b/lib/Minz/Request.php index 7625cf5ed..e74f4f908 100644 --- a/lib/Minz/Request.php +++ b/lib/Minz/Request.php @@ -43,6 +43,7 @@ class Minz_Request { if (isset(self::$params[$key])) { $p = self::$params[$key]; $tp = trim($p); + // @phpstan-ignore-next-line if ($p === null || $tp === '' || $tp === 'null') { return null; } elseif ($p == false || $tp == '0' || $tp === 'false' || $tp === 'no') { @@ -328,7 +329,7 @@ class Minz_Request { /** * Relance une requête - * @param array $url l'url vers laquelle est relancée la requête + * @param array> $url l'url vers laquelle est relancée la requête * @param bool $redirect si vrai, force la redirection http * > sinon, le dispatcher recharge en interne */ @@ -359,7 +360,7 @@ class Minz_Request { /** * Wrappers good notifications + redirection * @param string $msg notification content - * @param array $url url array to where we should be forwarded + * @param array> $url url array to where we should be forwarded */ public static function good($msg, $url = array()) { Minz_Request::setGoodNotification($msg); @@ -369,7 +370,7 @@ class Minz_Request { /** * Wrappers bad notifications + redirection * @param string $msg notification content - * @param array $url url array to where we should be forwarded + * @param array> $url url array to where we should be forwarded */ public static function bad($msg, $url = array()) { Minz_Request::setBadNotification($msg); -- cgit v1.2.3