Skip to content

Commit 94eee89

Browse files
Remove unused param (#18398)
* Update phpstan-baseline.neon Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Removed unused param Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Narrow return type Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> --------- Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
1 parent 0d13a6b commit 94eee89

3 files changed

Lines changed: 6 additions & 20 deletions

File tree

libraries/classes/Controllers/Export/ExportController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,6 @@ public function __invoke(ServerRequest $request): void
429429
$GLOBALS['errorUrl'],
430430
$GLOBALS['db'],
431431
$GLOBALS['sql_query'],
432-
$GLOBALS['export_type'],
433432
);
434433
} else {
435434
// We export just one table

libraries/classes/Export.php

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ public function exportDatabase(
752752
&& ! $isView
753753
) {
754754
$tableObj = new Table($table, $db->getName(), $this->dbi);
755-
$nonGeneratedCols = $tableObj->getNonGeneratedColumns(true);
755+
$nonGeneratedCols = $tableObj->getNonGeneratedColumns();
756756

757757
$localQuery = 'SELECT ' . implode(', ', $nonGeneratedCols)
758758
. ' FROM ' . Util::backquote($db->getName())
@@ -879,15 +879,13 @@ public function exportDatabase(
879879
* @param string $errorUrl the URL in case of error
880880
* @param string|null $db the database where the query is executed
881881
* @param string $sqlQuery the query to be executed
882-
* @param string $exportType the export type
883882
*/
884883
public static function exportRaw(
885884
string $whatStrucOrData,
886885
ExportPlugin $exportPlugin,
887886
string $errorUrl,
888887
string|null $db,
889888
string $sqlQuery,
890-
string $exportType,
891889
): void {
892890
// In case the we need to dump just the raw query
893891
if ($whatStrucOrData !== 'raw') {
@@ -1013,7 +1011,7 @@ public function exportTable(
10131011
} else {
10141012
// Data is exported only for Non-generated columns
10151013
$tableObj = new Table($table, $db, $this->dbi);
1016-
$nonGeneratedCols = $tableObj->getNonGeneratedColumns(true);
1014+
$nonGeneratedCols = $tableObj->getNonGeneratedColumns();
10171015

10181016
$localQuery = 'SELECT ' . implode(', ', $nonGeneratedCols)
10191017
. ' FROM ' . Util::backquote($db)
@@ -1159,10 +1157,8 @@ public function mergeAliases(array $aliases1, array $aliases2): array
11591157
* @param DatabaseName $db database name
11601158
* @param mixed[] $tables list of table names
11611159
* @param string $lockType lock type; "[LOW_PRIORITY] WRITE" or "READ [LOCAL]"
1162-
*
1163-
* @return mixed result of the query
11641160
*/
1165-
public function lockTables(DatabaseName $db, array $tables, string $lockType = 'WRITE'): mixed
1161+
public function lockTables(DatabaseName $db, array $tables, string $lockType = 'WRITE'): void
11661162
{
11671163
$locks = [];
11681164
foreach ($tables as $table) {
@@ -1172,17 +1168,15 @@ public function lockTables(DatabaseName $db, array $tables, string $lockType = '
11721168

11731169
$sql = 'LOCK TABLES ' . implode(', ', $locks);
11741170

1175-
return $this->dbi->tryQuery($sql);
1171+
$this->dbi->tryQuery($sql);
11761172
}
11771173

11781174
/**
11791175
* Releases table locks
1180-
*
1181-
* @return mixed result of the query
11821176
*/
1183-
public function unlockTables(): mixed
1177+
public function unlockTables(): void
11841178
{
1185-
return $this->dbi->tryQuery('UNLOCK TABLES');
1179+
$this->dbi->tryQuery('UNLOCK TABLES');
11861180
}
11871181

11881182
/**

psalm-baseline.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6680,13 +6680,6 @@
66806680
<PossiblyNullArgument>
66816681
<code><![CDATA[$GLOBALS['file_handle']]]></code>
66826682
</PossiblyNullArgument>
6683-
<PossiblyUnusedParam>
6684-
<code>$exportType</code>
6685-
</PossiblyUnusedParam>
6686-
<PossiblyUnusedReturnValue>
6687-
<code>mixed</code>
6688-
<code>mixed</code>
6689-
</PossiblyUnusedReturnValue>
66906683
<RedundantCondition>
66916684
<code>mb_strtolower($userExtension) !== $requiredExtension</code>
66926685
<code>mb_strtolower($userExtension) !== $requiredExtension</code>

0 commit comments

Comments
 (0)