More specific return type
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
parent
1582b69591
commit
477e867cab
@ -40,6 +40,7 @@ use function _ngettext;
|
||||
use function array_intersect_key;
|
||||
use function array_key_exists;
|
||||
use function array_keys;
|
||||
use function array_map;
|
||||
use function array_merge;
|
||||
use function array_shift;
|
||||
use function base64_decode;
|
||||
@ -289,16 +290,11 @@ class NavigationTree
|
||||
*
|
||||
* @param string $string The path to parse
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return non-empty-list<string>
|
||||
*/
|
||||
private function parsePath(string $string): array
|
||||
{
|
||||
$path = explode('.', $string);
|
||||
foreach ($path as $key => $value) {
|
||||
$path[$key] = base64_decode($value);
|
||||
}
|
||||
|
||||
return $path;
|
||||
return array_map(base64_decode(...), explode('.', $string));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -4675,6 +4675,11 @@ parameters:
|
||||
count: 1
|
||||
path: libraries/classes/Navigation/NavigationTree.php
|
||||
|
||||
-
|
||||
message: "#^Method PhpMyAdmin\\\\Navigation\\\\NavigationTree\\:\\:parsePath\\(\\) should return non\\-empty\\-array\\<int, string\\> but returns non\\-empty\\-array\\<int, string\\|false\\>\\.$#"
|
||||
count: 1
|
||||
path: libraries/classes/Navigation/NavigationTree.php
|
||||
|
||||
-
|
||||
message: "#^Only numeric types are allowed in \\+, int\\|false given on the left side\\.$#"
|
||||
count: 1
|
||||
|
||||
@ -7687,6 +7687,12 @@
|
||||
<code><![CDATA[$this->pos3Name]]></code>
|
||||
<code><![CDATA[$this->pos3Name]]></code>
|
||||
</InvalidPropertyAssignmentValue>
|
||||
<InvalidReturnStatement>
|
||||
<code><![CDATA[array_map(base64_decode(...), explode('.', $string))]]></code>
|
||||
</InvalidReturnStatement>
|
||||
<InvalidReturnType>
|
||||
<code><![CDATA[non-empty-list<string>]]></code>
|
||||
</InvalidReturnType>
|
||||
<MixedArgument>
|
||||
<code>$db</code>
|
||||
<code>$item</code>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user