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/Translate.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/Translate.php')
| -rw-r--r-- | lib/Minz/Translate.php | 6 |
1 files changed, 3 insertions, 3 deletions
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<string> $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<string> $args + * @param mixed $args */ function _t($key, ...$args) { return Minz_Translate::t($key, ...$args); |
