Merge #18465 - Use array shape for getPaths

Pull-request: #18465

Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
William Desportes 2023-05-29 13:03:37 +02:00
commit 62a44a78bb
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889
4 changed files with 4 additions and 35 deletions

View File

@ -955,13 +955,13 @@ class NavigationTree
$paths = $node->getPaths();
if (isset($paths['aPath_clean'][2])) {
$renderDetails['position'] = 'pos2_nav';
$renderDetails['data_name'] = (string) $paths['aPath_clean'][2];
$renderDetails['data_name'] = $paths['aPath_clean'][2];
$renderDetails['data_value'] = (string) $node->pos2;
}
if (isset($paths['aPath_clean'][4])) {
$renderDetails['position'] = 'pos3_nav';
$renderDetails['data_name'] = (string) $paths['aPath_clean'][4];
$renderDetails['data_name'] = $paths['aPath_clean'][4];
$renderDetails['data_value'] = (string) $node->pos3;
}
@ -1157,7 +1157,7 @@ class NavigationTree
'pagination_params' => $paginationParams,
'node_is_group' => $nodeIsGroup ?? false,
'link_classes' => $linkClasses ?? '',
'paths' => ['a_path' => $paths['aPath'] ?? '', 'v_path' => $paths['vPath'] ?? '', 'pos' => $this->pos],
'paths' => ['a_path' => $paths['aPath'], 'v_path' => $paths['vPath'], 'pos' => $this->pos],
'node_icon' => $nodeIcon ?? '',
]);
}

View File

@ -313,7 +313,7 @@ class Node
* Returns the actual path and the virtual paths for a node
* both as clean arrays and base64 encoded strings
*
* @return mixed[]
* @return array{aPath: string, aPath_clean: string[], vPath: string, vPath_clean: string[]}
*/
public function getPaths(): array
{

View File

@ -4640,16 +4640,6 @@ parameters:
count: 2
path: libraries/classes/Navigation/NavigationTree.php
-
message: "#^Cannot access offset 2 on mixed\\.$#"
count: 2
path: libraries/classes/Navigation/NavigationTree.php
-
message: "#^Cannot access offset 4 on mixed\\.$#"
count: 1
path: libraries/classes/Navigation/NavigationTree.php
-
message: "#^Cannot access property \\$pos2 on PhpMyAdmin\\\\Navigation\\\\Nodes\\\\Node\\|null\\.$#"
count: 1
@ -4660,11 +4650,6 @@ parameters:
count: 1
path: libraries/classes/Navigation/NavigationTree.php
-
message: "#^Cannot cast mixed to string\\.$#"
count: 1
path: libraries/classes/Navigation/NavigationTree.php
-
message: "#^Casting to string something that's already string\\.$#"
count: 4
@ -4720,11 +4705,6 @@ parameters:
count: 10
path: libraries/classes/Navigation/NavigationTree.php
-
message: "#^Parameter \\#2 \\$paths of method PhpMyAdmin\\\\Navigation\\\\NavigationTree\\:\\:findTreeMatch\\(\\) expects array, mixed given\\.$#"
count: 1
path: libraries/classes/Navigation/NavigationTree.php
-
message: "#^Parameter \\#2 \\$searchClause of method PhpMyAdmin\\\\Navigation\\\\Nodes\\\\NodeDatabase\\:\\:getPresence\\(\\) expects string, mixed given\\.$#"
count: 1
@ -4735,11 +4715,6 @@ parameters:
count: 1
path: libraries/classes/Navigation/Nodes/Node.php
-
message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#"
count: 1
path: libraries/classes/Navigation/Nodes/Node.php
-
message: "#^Parameter \\#2 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#"
count: 3

View File

@ -7709,7 +7709,6 @@
<code>$path[0]</code>
<code>$path[0]</code>
<code>$path[0]</code>
<code><![CDATA[$paths['vPath_clean']]]></code>
<code>$separator</code>
<code>$separator</code>
<code>$value</code>
@ -7717,9 +7716,6 @@
<MixedArrayAccess>
<code><![CDATA[$node->secondIcon['image']]]></code>
<code><![CDATA[$node->secondIcon['title']]]></code>
<code><![CDATA[$paths['aPath_clean'][2]]]></code>
<code><![CDATA[$paths['aPath_clean'][4]]]></code>
<code><![CDATA[$paths['aPath_clean'][4]]]></code>
</MixedArrayAccess>
<MixedAssignment>
<code>$db</code>
@ -7731,7 +7727,6 @@
<code>$path</code>
<code>$separator</code>
<code>$separator</code>
<code><![CDATA[$urlParams['pos3_name']]]></code>
<code>$value</code>
</MixedAssignment>
<MixedOperand>
@ -7825,7 +7820,6 @@
<code>$db</code>
<code>$db</code>
<code>$db</code>
<code><![CDATA[$paths['aPath_clean']]]></code>
</MixedArgument>
<MixedAssignment>
<code>$child</code>