Fix type hints

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
Kamil Tekiela 2024-12-17 21:56:46 +00:00
parent eaa9f2d051
commit fb130367a0
3 changed files with 15 additions and 34 deletions

View File

@ -4678,7 +4678,7 @@ parameters:
path: src/Controllers/Table/RelationController.php
-
message: '#^Parameter \#1 \$multiEditColumnsName of method PhpMyAdmin\\Table\\Table\:\:updateInternalRelations\(\) expects array\<mixed\>, mixed given\.$#'
message: '#^Parameter \#1 \$multiEditColumnsName of method PhpMyAdmin\\Table\\Table\:\:updateInternalRelations\(\) expects array\<string\>, mixed given\.$#'
identifier: argument.type
count: 1
path: src/Controllers/Table/RelationController.php
@ -4690,7 +4690,7 @@ parameters:
path: src/Controllers/Table/RelationController.php
-
message: '#^Parameter \#2 \$destinationDb of method PhpMyAdmin\\Table\\Table\:\:updateInternalRelations\(\) expects array\<mixed\>, mixed given\.$#'
message: '#^Parameter \#2 \$destinationDb of method PhpMyAdmin\\Table\\Table\:\:updateInternalRelations\(\) expects array\<string\>, mixed given\.$#'
identifier: argument.type
count: 1
path: src/Controllers/Table/RelationController.php
@ -4720,7 +4720,7 @@ parameters:
path: src/Controllers/Table/RelationController.php
-
message: '#^Parameter \#3 \$destinationTable of method PhpMyAdmin\\Table\\Table\:\:updateInternalRelations\(\) expects array\<mixed\>, mixed given\.$#'
message: '#^Parameter \#3 \$destinationTable of method PhpMyAdmin\\Table\\Table\:\:updateInternalRelations\(\) expects array\<string\|null\>, mixed given\.$#'
identifier: argument.type
count: 1
path: src/Controllers/Table/RelationController.php
@ -4732,7 +4732,7 @@ parameters:
path: src/Controllers/Table/RelationController.php
-
message: '#^Parameter \#4 \$destinationColumn of method PhpMyAdmin\\Table\\Table\:\:updateInternalRelations\(\) expects array\<mixed\>, mixed given\.$#'
message: '#^Parameter \#4 \$destinationColumn of method PhpMyAdmin\\Table\\Table\:\:updateInternalRelations\(\) expects array\<string\|null\>, mixed given\.$#'
identifier: argument.type
count: 1
path: src/Controllers/Table/RelationController.php
@ -17337,12 +17337,6 @@ parameters:
count: 3
path: src/Table/Table.php
-
message: '#^Parameter \#1 \$str of method PhpMyAdmin\\DatabaseInterface\:\:quoteString\(\) expects string, mixed given\.$#'
identifier: argument.type
count: 9
path: src/Table/Table.php
-
message: '#^Parameter \#1 \$string of function substr expects string, mixed given\.$#'
identifier: argument.type

View File

@ -2982,16 +2982,17 @@
<code><![CDATA[Config::getInstance()]]></code>
</DeprecatedMethod>
<InvalidArgument>
<code><![CDATA[$_POST['destination_column']]]></code>
<code><![CDATA[$_POST['destination_db']]]></code>
<code><![CDATA[$_POST['destination_foreign_column']]]></code>
<code><![CDATA[$_POST['destination_foreign_db']]]></code>
<code><![CDATA[$_POST['destination_foreign_table']]]></code>
<code><![CDATA[$_POST['destination_table']]]></code>
<code><![CDATA[$multiEditColumnsName]]></code>
<code><![CDATA[$multiEditColumnsName]]></code>
<code><![CDATA[usort($tables, strnatcasecmp(...))]]></code>
</InvalidArgument>
<PossiblyInvalidArgument>
<code><![CDATA[$_POST['destination_column']]]></code>
<code><![CDATA[$_POST['destination_db']]]></code>
<code><![CDATA[$_POST['destination_table']]]></code>
<code><![CDATA[$_POST['display_field']]]></code>
<code><![CDATA[$_POST['foreignDb']]]></code>
<code><![CDATA[$_POST['foreignDb']]]></code>
@ -2999,7 +3000,6 @@
<code><![CDATA[$_POST['foreignDb']]]></code>
<code><![CDATA[$foreignTable]]></code>
<code><![CDATA[$foreignTable]]></code>
<code><![CDATA[$multiEditColumnsName]]></code>
</PossiblyInvalidArgument>
<PossiblyInvalidCast>
<code><![CDATA[$_POST['display_field']]]></code>
@ -9929,17 +9929,8 @@
<code><![CDATA[$column['Extra']]]></code>
<code><![CDATA[$column['Extra']]]></code>
<code><![CDATA[$fields[$column]['expr']]]></code>
<code><![CDATA[$foreignDb]]></code>
<code><![CDATA[$foreignDb]]></code>
<code><![CDATA[$foreignField]]></code>
<code><![CDATA[$foreignField]]></code>
<code><![CDATA[$foreignTable]]></code>
<code><![CDATA[$foreignTable]]></code>
<code><![CDATA[$index]]></code>
<code><![CDATA[$index[0]]]></code>
<code><![CDATA[$masterField]]></code>
<code><![CDATA[$masterField]]></code>
<code><![CDATA[$masterField]]></code>
<code><![CDATA[$options['expr']]]></code>
<code><![CDATA[$row['Type']]]></code>
<code><![CDATA[$this->uiprefs[$property->value]]]></code>
@ -9970,8 +9961,6 @@
<MixedArrayOffset>
<code><![CDATA[$columns[$row['Field']]]]></code>
<code><![CDATA[$columns[$row['Field']]]]></code>
<code><![CDATA[$existrel[$masterField]]]></code>
<code><![CDATA[$existrel[$masterField]]]></code>
<code><![CDATA[$optionsArray[$_POST['on_delete'][$masterFieldMd5]]]]></code>
<code><![CDATA[$optionsArray[$_POST['on_update'][$masterFieldMd5]]]]></code>
</MixedArrayOffset>
@ -9979,11 +9968,7 @@
<code><![CDATA[$column]]></code>
<code><![CDATA[$column]]></code>
<code><![CDATA[$columns[$row['Field']]]]></code>
<code><![CDATA[$foreignDb]]></code>
<code><![CDATA[$foreignField]]></code>
<code><![CDATA[$foreignTable]]></code>
<code><![CDATA[$index]]></code>
<code><![CDATA[$masterField]]></code>
<code><![CDATA[$ret[]]]></code>
<code><![CDATA[$row]]></code>
<code><![CDATA[$value]]></code>
@ -10033,9 +10018,11 @@
<RiskyTruthyFalsyComparison>
<code><![CDATA[empty($existrelForeign[$masterFieldMd5]->onDelete)]]></code>
<code><![CDATA[empty($existrelForeign[$masterFieldMd5]->onUpdate)]]></code>
<code><![CDATA[empty($foreignField)]]></code>
<code><![CDATA[empty($foreignField[$key])]]></code>
<code><![CDATA[empty($foreignField[$key])]]></code>
<code><![CDATA[empty($foreignField[$key])]]></code>
<code><![CDATA[empty($foreignTable)]]></code>
</RiskyTruthyFalsyComparison>
<UnsupportedPropertyReferenceUsage>
<code><![CDATA[$this->uiprefs =& $_SESSION['tmpval']['table_uiprefs'][$serverId][$this->dbName][$this->name]]]></code>

View File

@ -1355,11 +1355,11 @@ class Table implements Stringable
/**
* Function to get update query for updating internal relations
*
* @param mixed[] $multiEditColumnsName multi edit column names
* @param mixed[] $destinationDb destination tables
* @param mixed[] $destinationTable destination tables
* @param mixed[] $destinationColumn destination columns
* @param mixed[]|null $existrel db, table, column
* @param string[] $multiEditColumnsName multi edit column names
* @param string[] $destinationDb destination tables
* @param (string|null)[] $destinationTable destination tables
* @param (string|null)[] $destinationColumn destination columns
* @param mixed[]|null $existrel db, table, column
*/
public function updateInternalRelations(
array $multiEditColumnsName,