Fix type hint in exportDatabase()

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

t
This commit is contained in:
Kamil Tekiela 2023-12-05 15:56:51 +01:00
parent 9d18c3d5e6
commit 48cd962475
3 changed files with 11 additions and 39 deletions

View File

@ -3226,7 +3226,7 @@ parameters:
path: src/Controllers/Export/ExportController.php
-
message: "#^Parameter \\#2 \\$tables of method PhpMyAdmin\\\\Export\\\\Export\\:\\:exportDatabase\\(\\) expects array, mixed given\\.$#"
message: "#^Parameter \\#2 \\$tables of method PhpMyAdmin\\\\Export\\\\Export\\:\\:exportDatabase\\(\\) expects array\\<string\\>, mixed given\\.$#"
count: 2
path: src/Controllers/Export/ExportController.php
@ -3301,7 +3301,7 @@ parameters:
path: src/Controllers/Export/ExportController.php
-
message: "#^Parameter \\#4 \\$tableStructure of method PhpMyAdmin\\\\Export\\\\Export\\:\\:exportDatabase\\(\\) expects array, mixed given\\.$#"
message: "#^Parameter \\#4 \\$tableStructure of method PhpMyAdmin\\\\Export\\\\Export\\:\\:exportDatabase\\(\\) expects array\\<string\\>, mixed given\\.$#"
count: 2
path: src/Controllers/Export/ExportController.php
@ -3321,7 +3321,7 @@ parameters:
path: src/Controllers/Export/ExportController.php
-
message: "#^Parameter \\#5 \\$tableData of method PhpMyAdmin\\\\Export\\\\Export\\:\\:exportDatabase\\(\\) expects array, mixed given\\.$#"
message: "#^Parameter \\#5 \\$tableData of method PhpMyAdmin\\\\Export\\\\Export\\:\\:exportDatabase\\(\\) expects array\\<string\\>, mixed given\\.$#"
count: 2
path: src/Controllers/Export/ExportController.php
@ -10267,7 +10267,7 @@ parameters:
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 5
count: 2
path: src/Export/Export.php
-
@ -10332,12 +10332,7 @@ parameters:
-
message: "#^Parameter \\#1 \\$identifier of static method PhpMyAdmin\\\\Util\\:\\:backquote\\(\\) expects string\\|Stringable\\|null, mixed given\\.$#"
count: 2
path: src/Export/Export.php
-
message: "#^Parameter \\#1 \\$name of class PhpMyAdmin\\\\Table\\\\Table constructor expects string, mixed given\\.$#"
count: 2
count: 1
path: src/Export/Export.php
-
@ -10345,11 +10340,6 @@ parameters:
count: 2
path: src/Export/Export.php
-
message: "#^Parameter \\#1 \\$str of method PhpMyAdmin\\\\DatabaseInterface\\:\\:quoteString\\(\\) expects string, mixed given\\.$#"
count: 1
path: src/Export/Export.php
-
message: "#^Parameter \\#1 \\$stream of function fwrite expects resource, mixed given\\.$#"
count: 2
@ -10370,21 +10360,6 @@ parameters:
count: 1
path: src/Export/Export.php
-
message: "#^Parameter \\#2 \\$table of method PhpMyAdmin\\\\Plugins\\\\ExportPlugin\\:\\:exportData\\(\\) expects string, mixed given\\.$#"
count: 1
path: src/Export/Export.php
-
message: "#^Parameter \\#2 \\$table of method PhpMyAdmin\\\\Plugins\\\\ExportPlugin\\:\\:exportStructure\\(\\) expects string, mixed given\\.$#"
count: 4
path: src/Export/Export.php
-
message: "#^Parameter \\#2 \\$tables of method PhpMyAdmin\\\\Plugins\\\\ExportPlugin\\:\\:exportMetadata\\(\\) expects array\\<string\\>\\|string, array given\\.$#"
count: 1
path: src/Export/Export.php
-
message: "#^Parameter \\#3 \\$dbAlias of method PhpMyAdmin\\\\Plugins\\\\ExportPlugin\\:\\:exportDBCreate\\(\\) expects string, mixed given\\.$#"
count: 1

View File

@ -5952,11 +5952,9 @@
<code>$dbAlias</code>
<code>$dbAlias</code>
<code>$table</code>
<code>$table</code>
</MixedArgument>
<MixedArgumentTypeCoercion>
<code>$dbSelect</code>
<code>$tables</code>
</MixedArgumentTypeCoercion>
<MixedArrayAccess>
<code><![CDATA[$aliases[$db->getName()]['alias']]]></code>
@ -5987,7 +5985,6 @@
<code>$dbAlias</code>
<code>$dbAlias</code>
<code>$table</code>
<code>$table</code>
<code>$tableName</code>
<code>$tbl</code>
<code>$val</code>

View File

@ -599,10 +599,10 @@ class Export
* Export at the database level
*
* @param DatabaseName $db the database to export
* @param mixed[] $tables the tables to export
* @param string[] $tables the tables to export
* @param string $whatStrucOrData structure or data or both
* @param mixed[] $tableStructure whether to export structure for each table
* @param mixed[] $tableData whether to export data for each table
* @param string[] $tableStructure whether to export structure for each table
* @param string[] $tableData whether to export data for each table
* @param ExportPlugin $exportPlugin the selected export plugin
* @param string $errorUrl the URL in case of error
* @param string $exportType the export type
@ -677,7 +677,7 @@ class Export
if (
($whatStrucOrData === 'structure'
|| $whatStrucOrData === 'structure_and_data')
&& in_array($table, $tableStructure)
&& in_array($table, $tableStructure, true)
) {
// for a view, export a stand-in definition of the table
// to resolve view dependencies (only when it's a single-file export)
@ -739,7 +739,7 @@ class Export
// if this is a view or a merge table, don't export data
if (
($whatStrucOrData === 'data' || $whatStrucOrData === 'structure_and_data')
&& in_array($table, $tableData)
&& in_array($table, $tableData, true)
&& ! $isView
) {
$tableObj = new Table($table, $db->getName(), $this->dbi);
@ -764,7 +764,7 @@ class Export
if (
! isset($GLOBALS['sql_create_trigger']) || ($whatStrucOrData !== 'structure'
&& $whatStrucOrData !== 'structure_and_data')
|| ! in_array($table, $tableStructure)
|| ! in_array($table, $tableStructure, true)
) {
continue;
}