diff --git a/libraries/classes/Navigation/NavigationTree.php b/libraries/classes/Navigation/NavigationTree.php index 9c39727ef9..2ce1a76aca 100644 --- a/libraries/classes/Navigation/NavigationTree.php +++ b/libraries/classes/Navigation/NavigationTree.php @@ -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 */ 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)); } /** diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 613ce8d2bd..1e2a19df50 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -4640,6 +4640,11 @@ parameters: count: 1 path: libraries/classes/Navigation/NavigationTree.php + - + message: "#^Method PhpMyAdmin\\\\Navigation\\\\NavigationTree\\:\\:parsePath\\(\\) should return non\\-empty\\-array\\ but returns non\\-empty\\-array\\\\.$#" + count: 1 + path: libraries/classes/Navigation/NavigationTree.php + - message: "#^Only numeric types are allowed in \\+, int\\|false given on the left side\\.$#" count: 1 diff --git a/psalm-baseline.xml b/psalm-baseline.xml index d3f4ad5a31..fd1872e5d4 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -7657,6 +7657,12 @@ pos3Name]]> pos3Name]]> + + + + + ]]> + $db $item