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/Translate.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/Minz/Translate.php') diff --git a/lib/Minz/Translate.php b/lib/Minz/Translate.php index 0659b0de2..4b860259e 100644 --- a/lib/Minz/Translate.php +++ b/lib/Minz/Translate.php @@ -85,7 +85,7 @@ class Minz_Translate { * Return the language to use in the application. * It returns the connected language if it exists then returns the first match from the * preferred languages then returns the default language - * @param string $user the connected user language (nullable) + * @param string|null $user the connected user language (nullable) * @param array $preferred an array of the preferred languages * @param string $default the preferred language to use * @return string containing the language to use @@ -179,7 +179,7 @@ class Minz_Translate { /** * Translate a key into its corresponding value based on selected language. * @param string $key the key to translate. - * @param string $args additional parameters for variable keys. + * @param mixed $args additional parameters for variable keys. * @return string value corresponding to the key. * If no value is found, return the key itself. */ @@ -247,7 +247,7 @@ class Minz_Translate { /** * Alias for Minz_Translate::t() * @param string $key - * @param array $args + * @param mixed $args */ function _t($key, ...$args) { return Minz_Translate::t($key, ...$args); -- cgit v1.2.3