Skip to content

Commit 6ee9e7d

Browse files
Merge pull request #18894 from kamil-tekiela/LanguageManager
Fix type hint in LanguageManager
2 parents 47012e4 + dc5cebe commit 6ee9e7d

4 files changed

Lines changed: 25 additions & 31 deletions

File tree

composer.lock

Lines changed: 18 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpstan-baseline.neon

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9836,7 +9836,7 @@ parameters:
98369836
path: src/LanguageManager.php
98379837

98389838
-
9839-
message: "#^Method PhpMyAdmin\\\\LanguageManager\\:\\:availableLocales\\(\\) should return array but returns array\\|false\\.$#"
9839+
message: "#^Method PhpMyAdmin\\\\LanguageManager\\:\\:availableLocales\\(\\) should return array\\<string\\> but returns array\\|false\\.$#"
98409840
count: 1
98419841
path: src/LanguageManager.php
98429842

@@ -9857,11 +9857,11 @@ parameters:
98579857

98589858
-
98599859
message: "#^Parameter \\#1 \\$string of function strtolower expects string, mixed given\\.$#"
9860-
count: 2
9860+
count: 1
98619861
path: src/LanguageManager.php
98629862

98639863
-
9864-
message: "#^Property PhpMyAdmin\\\\LanguageManager\\:\\:\\$availableLocales \\(array\\) does not accept array\\|false\\.$#"
9864+
message: "#^Property PhpMyAdmin\\\\LanguageManager\\:\\:\\$availableLocales \\(array\\<string\\>\\) does not accept array\\|false\\.$#"
98659865
count: 1
98669866
path: src/LanguageManager.php
98679867

psalm-baseline.xml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="5.18.0@b113f3ed0259fd6e212d87c3df80eec95a6abf19">
2+
<files psalm-version="5.19.0@06b71be009a6bd6d81b9811855d6629b9fe90e1b">
33
<file src="app/services_loader.php">
44
<MixedArgument>
55
<code>$argumentName</code>
@@ -6968,20 +6968,13 @@
69686968
<MixedArgument>
69696969
<code><![CDATA[$config->get('Lang')]]></code>
69706970
<code><![CDATA[$config->getCookie('pma_lang')]]></code>
6971-
<code>$lang</code>
69726971
</MixedArgument>
6973-
<MixedArgumentTypeCoercion>
6974-
<code><![CDATA[$this->listLocaleDir()]]></code>
6975-
</MixedArgumentTypeCoercion>
69766972
<MixedArrayOffset>
69776973
<code><![CDATA[$langs[$config->get('DefaultLang')]]]></code>
69786974
</MixedArrayOffset>
69796975
<MixedArrayTypeCoercion>
69806976
<code><![CDATA[$langs[$config->get('DefaultLang')]]]></code>
69816977
</MixedArrayTypeCoercion>
6982-
<MixedAssignment>
6983-
<code>$lang</code>
6984-
</MixedAssignment>
69856978
<MixedOperand>
69866979
<code><![CDATA[$config->get('FilterLanguages')]]></code>
69876980
</MixedOperand>

src/LanguageManager.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ class LanguageManager
708708
],
709709
];
710710

711-
/** @var mixed[] */
711+
/** @var string[] */
712712
private array $availableLocales = [];
713713

714714
/** @var array<string, Language> */
@@ -740,7 +740,7 @@ public static function getInstance(): LanguageManager
740740
/**
741741
* Returns list of available locales
742742
*
743-
* @return mixed[]
743+
* @return string[]
744744
*/
745745
public function listLocaleDir(): array
746746
{
@@ -780,7 +780,7 @@ public function listLocaleDir(): array
780780
/**
781781
* Returns (cached) list of all available locales
782782
*
783-
* @return mixed[] of strings
783+
* @return string[]
784784
*/
785785
public function availableLocales(): array
786786
{

0 commit comments

Comments
 (0)