Skip to content

Commit e1398f3

Browse files
Merge pull request #18424 from kamil-tekiela/Unused-params
Remove unused params
2 parents d362f79 + 90b5312 commit e1398f3

12 files changed

Lines changed: 60 additions & 163 deletions

File tree

libraries/classes/Controllers/Database/DesignerController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ public function __invoke(ServerRequest $request): void
111111
$this->response->addJSON('message', $GLOBALS['message']);
112112
} elseif ($operation === 'addNewRelation') {
113113
[$success, $GLOBALS['message']] = $this->designerCommon->addNewRelation(
114-
$db,
115114
$request->getParsedBodyParam('T1'),
116115
$request->getParsedBodyParam('F1'),
117116
$request->getParsedBodyParam('T2'),

libraries/classes/Database/Designer/Common.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,6 @@ public function saveDisplayField(string $db, string $table, string $field): arra
489489
/**
490490
* Adds a new foreign relation
491491
*
492-
* @param string $db database name
493492
* @param string $t1 foreign table
494493
* @param string $f1 foreign field
495494
* @param string $t2 master table
@@ -503,7 +502,6 @@ public function saveDisplayField(string $db, string $table, string $field): arra
503502
* @psalm-return array{0: bool, 1: string}
504503
*/
505504
public function addNewRelation(
506-
string $db,
507505
string $t1,
508506
string $f1,
509507
string $t2,

libraries/classes/Plugins/Export/ExportHtmlword.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@ public function getTableDefStandIn(string $db, string $view, array $aliases = []
317317
* export types which use this parameter
318318
* @param bool $doMime whether to include mime comments
319319
* at the end
320-
* @param bool $view whether we're handling a view
321320
* @param mixed[] $aliases Aliases of db/table/columns
322321
*
323322
* @return string resulting schema
@@ -328,7 +327,6 @@ public function getTableDef(
328327
bool $doRelation,
329328
bool $doComments,
330329
bool $doMime,
331-
bool $view = false,
332330
array $aliases = [],
333331
): string {
334332
$relationParameters = $this->relation->getRelationParameters();
@@ -532,7 +530,7 @@ public function exportStructure(
532530
. __('Table structure for table') . ' '
533531
. htmlspecialchars($tableAlias)
534532
. '</h2>';
535-
$dump .= $this->getTableDef($db, $table, $doRelation, $doComments, $doMime, false, $aliases);
533+
$dump .= $this->getTableDef($db, $table, $doRelation, $doComments, $doMime, $aliases);
536534
break;
537535
case 'triggers':
538536
$triggers = Triggers::getDetails($GLOBALS['dbi'], $db, $table);
@@ -548,7 +546,7 @@ public function exportStructure(
548546
$dump .= '<h2>'
549547
. __('Structure for view') . ' ' . htmlspecialchars($tableAlias)
550548
. '</h2>';
551-
$dump .= $this->getTableDef($db, $table, $doRelation, $doComments, $doMime, true, $aliases);
549+
$dump .= $this->getTableDef($db, $table, $doRelation, $doComments, $doMime, $aliases);
552550
break;
553551
case 'stand_in':
554552
$dump .= '<h2>'

libraries/classes/Plugins/Export/ExportOdt.php

Lines changed: 13 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -387,32 +387,24 @@ public function getTableDefStandIn(string $db, string $view, array $aliases = []
387387
/**
388388
* Returns $table's CREATE definition
389389
*
390-
* @param string $db the database name
391-
* @param string $table the table name
392-
* @param string $errorUrl the url to go back in case of error
393-
* @param bool $doRelation whether to include relation comments
394-
* @param bool $doComments whether to include the pmadb-style column
395-
* comments as comments in the structure;
396-
* this is deprecated but the parameter is
397-
* left here because /export calls
398-
* PMA_exportStructure() also for other
399-
* @param bool $doMime whether to include mime comments
400-
* @param bool $showDates whether to include creation/update/check dates
401-
* @param bool $addSemicolon whether to add semicolon and end-of-line at
402-
* the end
403-
* @param bool $view whether we're handling a view
404-
* @param mixed[] $aliases Aliases of db/table/columns
390+
* @param string $db the database name
391+
* @param string $table the table name
392+
* @param bool $doRelation whether to include relation comments
393+
* @param bool $doComments whether to include the pmadb-style column
394+
* comments as comments in the structure;
395+
* this is deprecated but the parameter is
396+
* left here because /export calls
397+
* PMA_exportStructure() also for other
398+
* @param bool $doMime whether to include mime comments
399+
* the end
400+
* @param mixed[] $aliases Aliases of db/table/columns
405401
*/
406402
public function getTableDef(
407403
string $db,
408404
string $table,
409-
string $errorUrl,
410405
bool $doRelation,
411406
bool $doComments,
412407
bool $doMime,
413-
bool $showDates = false,
414-
bool $addSemicolon = true,
415-
bool $view = false,
416408
array $aliases = [],
417409
): bool {
418410
$dbAlias = $db;
@@ -660,18 +652,7 @@ public function exportStructure(
660652
. __('Table structure for table') . ' ' .
661653
htmlspecialchars($tableAlias)
662654
. '</text:h>';
663-
$this->getTableDef(
664-
$db,
665-
$table,
666-
$errorUrl,
667-
$doRelation,
668-
$doComments,
669-
$doMime,
670-
$dates,
671-
true,
672-
false,
673-
$aliases,
674-
);
655+
$this->getTableDef($db, $table, $doRelation, $doComments, $doMime, $aliases);
675656
break;
676657
case 'triggers':
677658
$triggers = Triggers::getDetails($GLOBALS['dbi'], $db, $table);
@@ -691,18 +672,7 @@ public function exportStructure(
691672
. __('Structure for view') . ' '
692673
. htmlspecialchars($tableAlias)
693674
. '</text:h>';
694-
$this->getTableDef(
695-
$db,
696-
$table,
697-
$errorUrl,
698-
$doRelation,
699-
$doComments,
700-
$doMime,
701-
$dates,
702-
true,
703-
true,
704-
$aliases,
705-
);
675+
$this->getTableDef($db, $table, $doRelation, $doComments, $doMime, $aliases);
706676
break;
707677
case 'stand_in':
708678
$GLOBALS['odt_buffer'] .= '<text:h text:outline-level="2" text:style-name="Heading_2"'

libraries/classes/Plugins/Export/ExportPdf.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,13 @@ public function exportStructure(
272272
*/
273273
switch ($exportMode) {
274274
case 'create_table':
275-
$pdf->getTableDef($db, $table, $doRelation, true, $doMime, false, $aliases);
275+
$pdf->getTableDef($db, $table, $doRelation, true, $doMime);
276276
break;
277277
case 'triggers':
278278
$pdf->getTriggers($db, $table);
279279
break;
280280
case 'create_view':
281-
$pdf->getTableDef($db, $table, $doRelation, true, $doMime, false, $aliases);
281+
$pdf->getTableDef($db, $table, $doRelation, true, $doMime);
282282
break;
283283
case 'stand_in':
284284
// export a stand-in definition to resolve view dependencies

libraries/classes/Plugins/Export/ExportTexytext.php

Lines changed: 14 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -305,35 +305,27 @@ public function getTableDefStandIn(string $db, string $view, array $aliases = []
305305
/**
306306
* Returns $table's CREATE definition
307307
*
308-
* @param string $db the database name
309-
* @param string $table the table name
310-
* @param string $errorUrl the url to go back in case of error
311-
* @param bool $doRelation whether to include relation comments
312-
* @param bool $doComments whether to include the pmadb-style column
313-
* comments as comments in the structure;
314-
* this is deprecated but the parameter is
315-
* left here because /export calls
316-
* $this->exportStructure() also for other
317-
* export types which use this parameter
318-
* @param bool $doMime whether to include mime comments
319-
* @param bool $showDates whether to include creation/update/check dates
320-
* @param bool $addSemicolon whether to add semicolon and end-of-line
321-
* at the end
322-
* @param bool $view whether we're handling a view
323-
* @param mixed[] $aliases Aliases of db/table/columns
308+
* @param string $db the database name
309+
* @param string $table the table name
310+
* @param bool $doRelation whether to include relation comments
311+
* @param bool $doComments whether to include the pmadb-style column
312+
* comments as comments in the structure;
313+
* this is deprecated but the parameter is
314+
* left here because /export calls
315+
* $this->exportStructure() also for other
316+
* export types which use this parameter
317+
* @param bool $doMime whether to include mime comments
318+
* at the end
319+
* @param mixed[] $aliases Aliases of db/table/columns
324320
*
325321
* @return string resulting schema
326322
*/
327323
public function getTableDef(
328324
string $db,
329325
string $table,
330-
string $errorUrl,
331326
bool $doRelation,
332327
bool $doComments,
333328
bool $doMime,
334-
bool $showDates = false,
335-
bool $addSemicolon = true,
336-
bool $view = false,
337329
array $aliases = [],
338330
): string {
339331
$relationParameters = $this->relation->getRelationParameters();
@@ -503,18 +495,7 @@ public function exportStructure(
503495
case 'create_table':
504496
$dump .= '== ' . __('Table structure for table') . ' '
505497
. $tableAlias . "\n\n";
506-
$dump .= $this->getTableDef(
507-
$db,
508-
$table,
509-
$errorUrl,
510-
$doRelation,
511-
$doComments,
512-
$doMime,
513-
$dates,
514-
true,
515-
false,
516-
$aliases,
517-
);
498+
$dump .= $this->getTableDef($db, $table, $doRelation, $doComments, $doMime, $aliases);
518499
break;
519500
case 'triggers':
520501
$triggers = Triggers::getDetails($GLOBALS['dbi'], $db, $table);
@@ -526,18 +507,7 @@ public function exportStructure(
526507
break;
527508
case 'create_view':
528509
$dump .= '== ' . __('Structure for view') . ' ' . $tableAlias . "\n\n";
529-
$dump .= $this->getTableDef(
530-
$db,
531-
$table,
532-
$errorUrl,
533-
$doRelation,
534-
$doComments,
535-
$doMime,
536-
$dates,
537-
true,
538-
true,
539-
$aliases,
540-
);
510+
$dump .= $this->getTableDef($db, $table, $doRelation, $doComments, $doMime, $aliases);
541511
break;
542512
case 'stand_in':
543513
$dump .= '== ' . __('Stand-in structure for view')

libraries/classes/Plugins/Export/Helpers/Pdf.php

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -431,27 +431,23 @@ public function getTriggers(string $db, string $table): void
431431
/**
432432
* Print $table's CREATE definition
433433
*
434-
* @param string $db the database name
435-
* @param string $table the table name
436-
* @param bool $doRelation whether to include relation comments
437-
* @param bool $doComments whether to include the pmadb-style column
438-
* comments as comments in the structure;
439-
* this is deprecated but the parameter is
440-
* left here because /export calls
441-
* PMA_exportStructure() also for other
442-
* export types which use this parameter
443-
* @param bool $doMime whether to include mime comments
444-
* @param bool $view whether we're handling a view
445-
* @param mixed[] $aliases aliases of db/table/columns
434+
* @param string $db the database name
435+
* @param string $table the table name
436+
* @param bool $doRelation whether to include relation comments
437+
* @param bool $doComments whether to include the pmadb-style column
438+
* comments as comments in the structure;
439+
* this is deprecated but the parameter is
440+
* left here because /export calls
441+
* PMA_exportStructure() also for other
442+
* export types which use this parameter
443+
* @param bool $doMime whether to include mime comments
446444
*/
447445
public function getTableDef(
448446
string $db,
449447
string $table,
450448
bool $doRelation,
451449
bool $doComments,
452450
bool $doMime,
453-
bool $view = false,
454-
array $aliases = [],
455451
): void {
456452
$relationParameters = $this->relation->getRelationParameters();
457453

libraries/classes/ZipExtension.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,10 @@ public function extract(string $file, string $entry): string|false
197197
*
198198
* @param mixed[]|string $data contents of the file/files
199199
* @param mixed[]|string $name name of the file/files in the archive
200-
* @param int $time the current timestamp
201200
*
202201
* @return string|false the ZIP file contents, or false if there was an error.
203202
*/
204-
public function createFile(array|string $data, array|string $name, int $time = 0): string|false
203+
public function createFile(array|string $data, array|string $name): string|false
205204
{
206205
$datasec = []; // Array to store compressed data
207206
$ctrlDir = []; // Central directory

0 commit comments

Comments
 (0)