diff options
| author | 2022-01-04 13:59:09 +0100 | |
|---|---|---|
| committer | 2022-01-04 13:59:09 +0100 | |
| commit | 1335a0e3cf11a0d4248e9eaaf748b89e6df741ef (patch) | |
| tree | ed6a8d17cef0581e5b0402dc8dfedd42fabfe9c7 /lib/Minz/Request.php | |
| parent | 0988b0c2be911133f883313bc3a858670192cc69 (diff) | |
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
Diffstat (limited to 'lib/Minz/Request.php')
| -rw-r--r-- | lib/Minz/Request.php | 7 |
1 files changed, 4 insertions, 3 deletions
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<string,string> $url l'url vers laquelle est relancée la requête + * @param array<string,string|array<string,string>> $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<string,string> $url url array to where we should be forwarded + * @param array<string,string|array<string,string>> $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<string,string> $url url array to where we should be forwarded + * @param array<string,string|array<string,mixed>> $url url array to where we should be forwarded */ public static function bad($msg, $url = array()) { Minz_Request::setBadNotification($msg); |
