diff --git a/libraries/classes/Controllers/Database/DesignerController.php b/libraries/classes/Controllers/Database/DesignerController.php
index c0c01c42c5..d416b010c5 100644
--- a/libraries/classes/Controllers/Database/DesignerController.php
+++ b/libraries/classes/Controllers/Database/DesignerController.php
@@ -111,7 +111,6 @@ class DesignerController extends AbstractController
$this->response->addJSON('message', $GLOBALS['message']);
} elseif ($operation === 'addNewRelation') {
[$success, $GLOBALS['message']] = $this->designerCommon->addNewRelation(
- $db,
$request->getParsedBodyParam('T1'),
$request->getParsedBodyParam('F1'),
$request->getParsedBodyParam('T2'),
diff --git a/libraries/classes/Database/Designer/Common.php b/libraries/classes/Database/Designer/Common.php
index 384a6d37ad..d192267295 100644
--- a/libraries/classes/Database/Designer/Common.php
+++ b/libraries/classes/Database/Designer/Common.php
@@ -489,7 +489,6 @@ class Common
/**
* Adds a new foreign relation
*
- * @param string $db database name
* @param string $t1 foreign table
* @param string $f1 foreign field
* @param string $t2 master table
@@ -503,7 +502,6 @@ class Common
* @psalm-return array{0: bool, 1: string}
*/
public function addNewRelation(
- string $db,
string $t1,
string $f1,
string $t2,
diff --git a/libraries/classes/Plugins/Export/ExportHtmlword.php b/libraries/classes/Plugins/Export/ExportHtmlword.php
index d0dd231329..27ef29f524 100644
--- a/libraries/classes/Plugins/Export/ExportHtmlword.php
+++ b/libraries/classes/Plugins/Export/ExportHtmlword.php
@@ -317,7 +317,6 @@ class ExportHtmlword extends ExportPlugin
* export types which use this parameter
* @param bool $doMime whether to include mime comments
* at the end
- * @param bool $view whether we're handling a view
* @param mixed[] $aliases Aliases of db/table/columns
*
* @return string resulting schema
@@ -328,7 +327,6 @@ class ExportHtmlword extends ExportPlugin
bool $doRelation,
bool $doComments,
bool $doMime,
- bool $view = false,
array $aliases = [],
): string {
$relationParameters = $this->relation->getRelationParameters();
@@ -532,7 +530,7 @@ class ExportHtmlword extends ExportPlugin
. __('Table structure for table') . ' '
. htmlspecialchars($tableAlias)
. '';
- $dump .= $this->getTableDef($db, $table, $doRelation, $doComments, $doMime, false, $aliases);
+ $dump .= $this->getTableDef($db, $table, $doRelation, $doComments, $doMime, $aliases);
break;
case 'triggers':
$triggers = Triggers::getDetails($GLOBALS['dbi'], $db, $table);
@@ -548,7 +546,7 @@ class ExportHtmlword extends ExportPlugin
$dump .= '
'
. __('Structure for view') . ' ' . htmlspecialchars($tableAlias)
. '
';
- $dump .= $this->getTableDef($db, $table, $doRelation, $doComments, $doMime, true, $aliases);
+ $dump .= $this->getTableDef($db, $table, $doRelation, $doComments, $doMime, $aliases);
break;
case 'stand_in':
$dump .= ''
diff --git a/libraries/classes/Plugins/Export/ExportOdt.php b/libraries/classes/Plugins/Export/ExportOdt.php
index cc3c0d495c..4a0174c648 100644
--- a/libraries/classes/Plugins/Export/ExportOdt.php
+++ b/libraries/classes/Plugins/Export/ExportOdt.php
@@ -387,32 +387,24 @@ class ExportOdt extends ExportPlugin
/**
* Returns $table's CREATE definition
*
- * @param string $db the database name
- * @param string $table the table name
- * @param string $errorUrl the url to go back in case of error
- * @param bool $doRelation whether to include relation comments
- * @param bool $doComments whether to include the pmadb-style column
- * comments as comments in the structure;
- * this is deprecated but the parameter is
- * left here because /export calls
- * PMA_exportStructure() also for other
- * @param bool $doMime whether to include mime comments
- * @param bool $showDates whether to include creation/update/check dates
- * @param bool $addSemicolon whether to add semicolon and end-of-line at
- * the end
- * @param bool $view whether we're handling a view
- * @param mixed[] $aliases Aliases of db/table/columns
+ * @param string $db the database name
+ * @param string $table the table name
+ * @param bool $doRelation whether to include relation comments
+ * @param bool $doComments whether to include the pmadb-style column
+ * comments as comments in the structure;
+ * this is deprecated but the parameter is
+ * left here because /export calls
+ * PMA_exportStructure() also for other
+ * @param bool $doMime whether to include mime comments
+ * the end
+ * @param mixed[] $aliases Aliases of db/table/columns
*/
public function getTableDef(
string $db,
string $table,
- string $errorUrl,
bool $doRelation,
bool $doComments,
bool $doMime,
- bool $showDates = false,
- bool $addSemicolon = true,
- bool $view = false,
array $aliases = [],
): bool {
$dbAlias = $db;
@@ -660,18 +652,7 @@ class ExportOdt extends ExportPlugin
. __('Table structure for table') . ' ' .
htmlspecialchars($tableAlias)
. '';
- $this->getTableDef(
- $db,
- $table,
- $errorUrl,
- $doRelation,
- $doComments,
- $doMime,
- $dates,
- true,
- false,
- $aliases,
- );
+ $this->getTableDef($db, $table, $doRelation, $doComments, $doMime, $aliases);
break;
case 'triggers':
$triggers = Triggers::getDetails($GLOBALS['dbi'], $db, $table);
@@ -691,18 +672,7 @@ class ExportOdt extends ExportPlugin
. __('Structure for view') . ' '
. htmlspecialchars($tableAlias)
. '';
- $this->getTableDef(
- $db,
- $table,
- $errorUrl,
- $doRelation,
- $doComments,
- $doMime,
- $dates,
- true,
- true,
- $aliases,
- );
+ $this->getTableDef($db, $table, $doRelation, $doComments, $doMime, $aliases);
break;
case 'stand_in':
$GLOBALS['odt_buffer'] .= 'getTableDef($db, $table, $doRelation, true, $doMime, false, $aliases);
+ $pdf->getTableDef($db, $table, $doRelation, true, $doMime);
break;
case 'triggers':
$pdf->getTriggers($db, $table);
break;
case 'create_view':
- $pdf->getTableDef($db, $table, $doRelation, true, $doMime, false, $aliases);
+ $pdf->getTableDef($db, $table, $doRelation, true, $doMime);
break;
case 'stand_in':
// export a stand-in definition to resolve view dependencies
diff --git a/libraries/classes/Plugins/Export/ExportTexytext.php b/libraries/classes/Plugins/Export/ExportTexytext.php
index ad6605b283..a2f8b69e1e 100644
--- a/libraries/classes/Plugins/Export/ExportTexytext.php
+++ b/libraries/classes/Plugins/Export/ExportTexytext.php
@@ -305,35 +305,27 @@ class ExportTexytext extends ExportPlugin
/**
* Returns $table's CREATE definition
*
- * @param string $db the database name
- * @param string $table the table name
- * @param string $errorUrl the url to go back in case of error
- * @param bool $doRelation whether to include relation comments
- * @param bool $doComments whether to include the pmadb-style column
- * comments as comments in the structure;
- * this is deprecated but the parameter is
- * left here because /export calls
- * $this->exportStructure() also for other
- * export types which use this parameter
- * @param bool $doMime whether to include mime comments
- * @param bool $showDates whether to include creation/update/check dates
- * @param bool $addSemicolon whether to add semicolon and end-of-line
- * at the end
- * @param bool $view whether we're handling a view
- * @param mixed[] $aliases Aliases of db/table/columns
+ * @param string $db the database name
+ * @param string $table the table name
+ * @param bool $doRelation whether to include relation comments
+ * @param bool $doComments whether to include the pmadb-style column
+ * comments as comments in the structure;
+ * this is deprecated but the parameter is
+ * left here because /export calls
+ * $this->exportStructure() also for other
+ * export types which use this parameter
+ * @param bool $doMime whether to include mime comments
+ * at the end
+ * @param mixed[] $aliases Aliases of db/table/columns
*
* @return string resulting schema
*/
public function getTableDef(
string $db,
string $table,
- string $errorUrl,
bool $doRelation,
bool $doComments,
bool $doMime,
- bool $showDates = false,
- bool $addSemicolon = true,
- bool $view = false,
array $aliases = [],
): string {
$relationParameters = $this->relation->getRelationParameters();
@@ -503,18 +495,7 @@ class ExportTexytext extends ExportPlugin
case 'create_table':
$dump .= '== ' . __('Table structure for table') . ' '
. $tableAlias . "\n\n";
- $dump .= $this->getTableDef(
- $db,
- $table,
- $errorUrl,
- $doRelation,
- $doComments,
- $doMime,
- $dates,
- true,
- false,
- $aliases,
- );
+ $dump .= $this->getTableDef($db, $table, $doRelation, $doComments, $doMime, $aliases);
break;
case 'triggers':
$triggers = Triggers::getDetails($GLOBALS['dbi'], $db, $table);
@@ -526,18 +507,7 @@ class ExportTexytext extends ExportPlugin
break;
case 'create_view':
$dump .= '== ' . __('Structure for view') . ' ' . $tableAlias . "\n\n";
- $dump .= $this->getTableDef(
- $db,
- $table,
- $errorUrl,
- $doRelation,
- $doComments,
- $doMime,
- $dates,
- true,
- true,
- $aliases,
- );
+ $dump .= $this->getTableDef($db, $table, $doRelation, $doComments, $doMime, $aliases);
break;
case 'stand_in':
$dump .= '== ' . __('Stand-in structure for view')
diff --git a/libraries/classes/Plugins/Export/Helpers/Pdf.php b/libraries/classes/Plugins/Export/Helpers/Pdf.php
index 3fb67a40cf..3f8dad6824 100644
--- a/libraries/classes/Plugins/Export/Helpers/Pdf.php
+++ b/libraries/classes/Plugins/Export/Helpers/Pdf.php
@@ -431,18 +431,16 @@ class Pdf extends PdfLib
/**
* Print $table's CREATE definition
*
- * @param string $db the database name
- * @param string $table the table name
- * @param bool $doRelation whether to include relation comments
- * @param bool $doComments whether to include the pmadb-style column
- * comments as comments in the structure;
- * this is deprecated but the parameter is
- * left here because /export calls
- * PMA_exportStructure() also for other
- * export types which use this parameter
- * @param bool $doMime whether to include mime comments
- * @param bool $view whether we're handling a view
- * @param mixed[] $aliases aliases of db/table/columns
+ * @param string $db the database name
+ * @param string $table the table name
+ * @param bool $doRelation whether to include relation comments
+ * @param bool $doComments whether to include the pmadb-style column
+ * comments as comments in the structure;
+ * this is deprecated but the parameter is
+ * left here because /export calls
+ * PMA_exportStructure() also for other
+ * export types which use this parameter
+ * @param bool $doMime whether to include mime comments
*/
public function getTableDef(
string $db,
@@ -450,8 +448,6 @@ class Pdf extends PdfLib
bool $doRelation,
bool $doComments,
bool $doMime,
- bool $view = false,
- array $aliases = [],
): void {
$relationParameters = $this->relation->getRelationParameters();
diff --git a/libraries/classes/ZipExtension.php b/libraries/classes/ZipExtension.php
index 7303ac1746..6c7880a70e 100644
--- a/libraries/classes/ZipExtension.php
+++ b/libraries/classes/ZipExtension.php
@@ -197,11 +197,10 @@ class ZipExtension
*
* @param mixed[]|string $data contents of the file/files
* @param mixed[]|string $name name of the file/files in the archive
- * @param int $time the current timestamp
*
* @return string|false the ZIP file contents, or false if there was an error.
*/
- public function createFile(array|string $data, array|string $name, int $time = 0): string|false
+ public function createFile(array|string $data, array|string $name): string|false
{
$datasec = []; // Array to store compressed data
$ctrlDir = []; // Central directory
diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon
index 00f815c37c..09af508aa8 100644
--- a/phpstan-baseline.neon
+++ b/phpstan-baseline.neon
@@ -825,11 +825,6 @@ parameters:
count: 1
path: libraries/classes/Controllers/Database/DesignerController.php
- -
- message: "#^Parameter \\#1 \\$db of method PhpMyAdmin\\\\Database\\\\Designer\\\\Common\\:\\:addNewRelation\\(\\) expects string, mixed given\\.$#"
- count: 1
- path: libraries/classes/Controllers/Database/DesignerController.php
-
-
message: "#^Parameter \\#1 \\$db of method PhpMyAdmin\\\\Database\\\\Designer\\\\Common\\:\\:getDefaultPage\\(\\) expects string, mixed given\\.$#"
count: 1
@@ -885,6 +880,11 @@ parameters:
count: 1
path: libraries/classes/Controllers/Database/DesignerController.php
+ -
+ message: "#^Parameter \\#1 \\$t1 of method PhpMyAdmin\\\\Database\\\\Designer\\\\Common\\:\\:addNewRelation\\(\\) expects string, mixed given\\.$#"
+ count: 1
+ path: libraries/classes/Controllers/Database/DesignerController.php
+
-
message: "#^Parameter \\#1 \\$t1 of method PhpMyAdmin\\\\Database\\\\Designer\\\\Common\\:\\:removeRelation\\(\\) expects string, mixed given\\.$#"
count: 1
@@ -895,6 +895,11 @@ parameters:
count: 1
path: libraries/classes/Controllers/Database/DesignerController.php
+ -
+ message: "#^Parameter \\#2 \\$f1 of method PhpMyAdmin\\\\Database\\\\Designer\\\\Common\\:\\:addNewRelation\\(\\) expects string, mixed given\\.$#"
+ count: 1
+ path: libraries/classes/Controllers/Database/DesignerController.php
+
-
message: "#^Parameter \\#2 \\$f1 of method PhpMyAdmin\\\\Database\\\\Designer\\\\Common\\:\\:removeRelation\\(\\) expects string, mixed given\\.$#"
count: 1
@@ -910,11 +915,6 @@ parameters:
count: 1
path: libraries/classes/Controllers/Database/DesignerController.php
- -
- message: "#^Parameter \\#2 \\$t1 of method PhpMyAdmin\\\\Database\\\\Designer\\\\Common\\:\\:addNewRelation\\(\\) expects string, mixed given\\.$#"
- count: 1
- path: libraries/classes/Controllers/Database/DesignerController.php
-
-
message: "#^Parameter \\#2 \\$table of method PhpMyAdmin\\\\Database\\\\Designer\\\\Common\\:\\:getTablesInfo\\(\\) expects string\\|null, mixed given\\.$#"
count: 2
@@ -931,12 +931,12 @@ parameters:
path: libraries/classes/Controllers/Database/DesignerController.php
-
- message: "#^Parameter \\#3 \\$f1 of method PhpMyAdmin\\\\Database\\\\Designer\\\\Common\\:\\:addNewRelation\\(\\) expects string, mixed given\\.$#"
+ message: "#^Parameter \\#3 \\$field of method PhpMyAdmin\\\\Database\\\\Designer\\\\Common\\:\\:saveDisplayField\\(\\) expects string, mixed given\\.$#"
count: 1
path: libraries/classes/Controllers/Database/DesignerController.php
-
- message: "#^Parameter \\#3 \\$field of method PhpMyAdmin\\\\Database\\\\Designer\\\\Common\\:\\:saveDisplayField\\(\\) expects string, mixed given\\.$#"
+ message: "#^Parameter \\#3 \\$t2 of method PhpMyAdmin\\\\Database\\\\Designer\\\\Common\\:\\:addNewRelation\\(\\) expects string, mixed given\\.$#"
count: 1
path: libraries/classes/Controllers/Database/DesignerController.php
@@ -945,38 +945,33 @@ parameters:
count: 1
path: libraries/classes/Controllers/Database/DesignerController.php
+ -
+ message: "#^Parameter \\#4 \\$f2 of method PhpMyAdmin\\\\Database\\\\Designer\\\\Common\\:\\:addNewRelation\\(\\) expects string, mixed given\\.$#"
+ count: 1
+ path: libraries/classes/Controllers/Database/DesignerController.php
+
-
message: "#^Parameter \\#4 \\$f2 of method PhpMyAdmin\\\\Database\\\\Designer\\\\Common\\:\\:removeRelation\\(\\) expects string, mixed given\\.$#"
count: 1
path: libraries/classes/Controllers/Database/DesignerController.php
-
- message: "#^Parameter \\#4 \\$t2 of method PhpMyAdmin\\\\Database\\\\Designer\\\\Common\\:\\:addNewRelation\\(\\) expects string, mixed given\\.$#"
+ message: "#^Parameter \\#5 \\$onDelete of method PhpMyAdmin\\\\Database\\\\Designer\\\\Common\\:\\:addNewRelation\\(\\) expects string, mixed given\\.$#"
count: 1
path: libraries/classes/Controllers/Database/DesignerController.php
-
- message: "#^Parameter \\#5 \\$f2 of method PhpMyAdmin\\\\Database\\\\Designer\\\\Common\\:\\:addNewRelation\\(\\) expects string, mixed given\\.$#"
+ message: "#^Parameter \\#6 \\$onUpdate of method PhpMyAdmin\\\\Database\\\\Designer\\\\Common\\:\\:addNewRelation\\(\\) expects string, mixed given\\.$#"
count: 1
path: libraries/classes/Controllers/Database/DesignerController.php
-
- message: "#^Parameter \\#6 \\$onDelete of method PhpMyAdmin\\\\Database\\\\Designer\\\\Common\\:\\:addNewRelation\\(\\) expects string, mixed given\\.$#"
+ message: "#^Parameter \\#7 \\$db1 of method PhpMyAdmin\\\\Database\\\\Designer\\\\Common\\:\\:addNewRelation\\(\\) expects string, mixed given\\.$#"
count: 1
path: libraries/classes/Controllers/Database/DesignerController.php
-
- message: "#^Parameter \\#7 \\$onUpdate of method PhpMyAdmin\\\\Database\\\\Designer\\\\Common\\:\\:addNewRelation\\(\\) expects string, mixed given\\.$#"
- count: 1
- path: libraries/classes/Controllers/Database/DesignerController.php
-
- -
- message: "#^Parameter \\#8 \\$db1 of method PhpMyAdmin\\\\Database\\\\Designer\\\\Common\\:\\:addNewRelation\\(\\) expects string, mixed given\\.$#"
- count: 1
- path: libraries/classes/Controllers/Database/DesignerController.php
-
- -
- message: "#^Parameter \\#9 \\$db2 of method PhpMyAdmin\\\\Database\\\\Designer\\\\Common\\:\\:addNewRelation\\(\\) expects string, mixed given\\.$#"
+ message: "#^Parameter \\#8 \\$db2 of method PhpMyAdmin\\\\Database\\\\Designer\\\\Common\\:\\:addNewRelation\\(\\) expects string, mixed given\\.$#"
count: 1
path: libraries/classes/Controllers/Database/DesignerController.php
diff --git a/psalm-baseline.xml b/psalm-baseline.xml
index 88e64377c1..e54eb12b74 100644
--- a/psalm-baseline.xml
+++ b/psalm-baseline.xml
@@ -996,7 +996,6 @@
$db
$db
$db
- $db
$html
$page
@@ -5142,9 +5141,6 @@
$indexArray1
$indexArray2
-
- $db
-
@@ -9201,9 +9197,6 @@
$comments
$mimeMap
-
- $view
-
bool
@@ -9428,12 +9421,6 @@
-
- $addSemicolon
- $errorUrl
- $showDates
- $view
-
string
@@ -9735,12 +9722,6 @@
$comments
$mimeMap
-
- $addSemicolon
- $errorUrl
- $showDates
- $view
-
@@ -10095,10 +10076,6 @@
$resRel
$resRel
-
- $aliases
- $view
-
$results
Pdf
@@ -13819,9 +13796,6 @@
$newData[$newName]
$value
-
- $time
-
diff --git a/test/classes/Plugins/Export/ExportOdtTest.php b/test/classes/Plugins/Export/ExportOdtTest.php
index 91ec902d24..86a1634b4d 100644
--- a/test/classes/Plugins/Export/ExportOdtTest.php
+++ b/test/classes/Plugins/Export/ExportOdtTest.php
@@ -632,7 +632,6 @@ class ExportOdtTest extends AbstractTestCase
$this->object->getTableDef(
'database',
'',
- 'example.com',
true,
true,
true,
@@ -715,7 +714,6 @@ class ExportOdtTest extends AbstractTestCase
$this->object->getTableDef(
'database',
'',
- 'example.com',
true,
true,
true,
diff --git a/test/classes/Plugins/Export/ExportTexytextTest.php b/test/classes/Plugins/Export/ExportTexytextTest.php
index 450c23905c..11b0e2942f 100644
--- a/test/classes/Plugins/Export/ExportTexytextTest.php
+++ b/test/classes/Plugins/Export/ExportTexytextTest.php
@@ -310,7 +310,7 @@ class ExportTexytextTest extends AbstractTestCase
[$GLOBALS['server'] => $relationParameters],
);
- $result = $this->object->getTableDef('db', 'table', 'example.com', true, true, true);
+ $result = $this->object->getTableDef('db', 'table', true, true, true);
$this->assertStringContainsString('1|<ftable (ffield>)|comm|Test<', $result);
}