From dc5cebec061e4c0ba5264fb712ad6c1c23ee80c9 Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Tue, 9 Jan 2024 23:05:49 +0100 Subject: [PATCH] Fix type hint in LanguageManager Signed-off-by: Kamil Tekiela --- composer.lock | 35 ++++++++++++++++++----------------- phpstan-baseline.neon | 6 +++--- psalm-baseline.xml | 9 +-------- src/LanguageManager.php | 6 +++--- 4 files changed, 25 insertions(+), 31 deletions(-) diff --git a/composer.lock b/composer.lock index 59fc94ae0a..31e159361a 100644 --- a/composer.lock +++ b/composer.lock @@ -4656,16 +4656,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.51", + "version": "1.10.55", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "5082fa72dc13944578806ca1196a385818d8b077" + "reference": "9a88f9d18ddf4cf54c922fbeac16c4cb164c5949" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/5082fa72dc13944578806ca1196a385818d8b077", - "reference": "5082fa72dc13944578806ca1196a385818d8b077", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9a88f9d18ddf4cf54c922fbeac16c4cb164c5949", + "reference": "9a88f9d18ddf4cf54c922fbeac16c4cb164c5949", "shasum": "" }, "require": { @@ -4714,7 +4714,7 @@ "type": "tidelift" } ], - "time": "2024-01-04T21:16:30+00:00" + "time": "2024-01-08T12:32:40+00:00" }, { "name": "phpstan/phpstan-phpunit", @@ -5708,12 +5708,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "680412bededc90d0b1e713621cc96d654aaba888" + "reference": "b3fcb6d7942e8ad987f8cccc11bb2ba496789ce4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/680412bededc90d0b1e713621cc96d654aaba888", - "reference": "680412bededc90d0b1e713621cc96d654aaba888", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/b3fcb6d7942e8ad987f8cccc11bb2ba496789ce4", + "reference": "b3fcb6d7942e8ad987f8cccc11bb2ba496789ce4", "shasum": "" }, "conflict": { @@ -5875,8 +5875,8 @@ "firebase/php-jwt": "<6", "fixpunkt/fp-masterquiz": "<2.2.1|>=3,<3.5.2", "fixpunkt/fp-newsletter": "<1.1.1|>=2,<2.1.2|>=2.2,<3.2.6", - "flarum/core": "<1.8", - "flarum/framework": "<1.8", + "flarum/core": "<1.8.5", + "flarum/framework": "<1.8.5", "flarum/mentions": "<1.6.3", "flarum/sticky": ">=0.1.0.0-beta14,<=0.1.0.0-beta15", "flarum/tags": "<=0.1.0.0-beta13", @@ -5914,7 +5914,7 @@ "gos/web-socket-bundle": "<1.10.4|>=2,<2.6.1|>=3,<3.3", "gree/jose": "<2.2.1", "gregwar/rst": "<1.0.3", - "grumpydictator/firefly-iii": "<6", + "grumpydictator/firefly-iii": "<6.1.1", "gugoan/economizzer": "<=0.9.0.0-beta1", "guzzlehttp/guzzle": "<6.5.8|>=7,<7.4.5", "guzzlehttp/psr7": "<1.9.1|>=2,<2.4.5", @@ -5965,6 +5965,7 @@ "joyqi/hyper-down": "<=2.4.27", "jsdecena/laracom": "<2.0.9", "jsmitty12/phpwhois": "<5.1", + "juzaweb/cms": "<=3.4", "kazist/phpwhois": "<=4.2.6", "kelvinmo/simplexrd": "<3.1.1", "kevinpapst/kimai2": "<1.16.7", @@ -6424,7 +6425,7 @@ "type": "tidelift" } ], - "time": "2024-01-04T21:04:31+00:00" + "time": "2024-01-09T18:04:23+00:00" }, { "name": "sebastian/cli-parser", @@ -8364,16 +8365,16 @@ }, { "name": "vimeo/psalm", - "version": "5.18.0", + "version": "5.19.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "b113f3ed0259fd6e212d87c3df80eec95a6abf19" + "reference": "06b71be009a6bd6d81b9811855d6629b9fe90e1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/b113f3ed0259fd6e212d87c3df80eec95a6abf19", - "reference": "b113f3ed0259fd6e212d87c3df80eec95a6abf19", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/06b71be009a6bd6d81b9811855d6629b9fe90e1b", + "reference": "06b71be009a6bd6d81b9811855d6629b9fe90e1b", "shasum": "" }, "require": { @@ -8470,7 +8471,7 @@ "issues": "https://github.com/vimeo/psalm/issues", "source": "https://github.com/vimeo/psalm" }, - "time": "2023-12-16T09:37:35+00:00" + "time": "2024-01-09T21:02:43+00:00" }, { "name": "web-auth/cose-lib", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index e0dbd956af..ba3dd55e28 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -9836,7 +9836,7 @@ parameters: path: src/LanguageManager.php - - message: "#^Method PhpMyAdmin\\\\LanguageManager\\:\\:availableLocales\\(\\) should return array but returns array\\|false\\.$#" + message: "#^Method PhpMyAdmin\\\\LanguageManager\\:\\:availableLocales\\(\\) should return array\\ but returns array\\|false\\.$#" count: 1 path: src/LanguageManager.php @@ -9857,11 +9857,11 @@ parameters: - message: "#^Parameter \\#1 \\$string of function strtolower expects string, mixed given\\.$#" - count: 2 + count: 1 path: src/LanguageManager.php - - message: "#^Property PhpMyAdmin\\\\LanguageManager\\:\\:\\$availableLocales \\(array\\) does not accept array\\|false\\.$#" + message: "#^Property PhpMyAdmin\\\\LanguageManager\\:\\:\\$availableLocales \\(array\\\\) does not accept array\\|false\\.$#" count: 1 path: src/LanguageManager.php diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 6bff330774..5f931c0f33 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + $argumentName @@ -6968,20 +6968,13 @@ get('Lang')]]> getCookie('pma_lang')]]> - $lang - - listLocaleDir()]]> - get('DefaultLang')]]]> get('DefaultLang')]]]> - - $lang - get('FilterLanguages')]]> diff --git a/src/LanguageManager.php b/src/LanguageManager.php index 360176214e..faa537c863 100644 --- a/src/LanguageManager.php +++ b/src/LanguageManager.php @@ -708,7 +708,7 @@ class LanguageManager ], ]; - /** @var mixed[] */ + /** @var string[] */ private array $availableLocales = []; /** @var array */ @@ -740,7 +740,7 @@ class LanguageManager /** * Returns list of available locales * - * @return mixed[] + * @return string[] */ public function listLocaleDir(): array { @@ -780,7 +780,7 @@ class LanguageManager /** * Returns (cached) list of all available locales * - * @return mixed[] of strings + * @return string[] */ public function availableLocales(): array {