Visitar URL original
Merge pull request #18085 from kamil-tekiela/remove-unused-variable-i… · phpmyadmin/phpmyadmin@c322389 · GitHub
Skip to content

Commit c322389

Browse files
Merge pull request #18085 from kamil-tekiela/remove-unused-variable-in-catch
Remove unused variable in catch
2 parents ef941c2 + 8433f66 commit c322389

16 files changed

Lines changed: 28 additions & 28 deletions

File tree

‎libraries/classes/Config.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ public function load(?string $source = null): bool
365365
try {
366366
/** @psalm-suppress UnresolvableInclude */
367367
$eval_result = include $this->getSource();
368-
} catch (Throwable $exception) {
368+
} catch (Throwable) {
369369
throw new ConfigException('Failed to load phpMyAdmin configuration.');
370370
}
371371

‎libraries/classes/ConfigStorage/RelationParameters.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public static function fromArray(array $params): self
139139

140140
try {
141141
$db = DatabaseName::fromValue($params['db'] ?? null);
142-
} catch (InvalidDatabaseName $exception) {
142+
} catch (InvalidDatabaseName) {
143143
return new self($user, null);
144144
}
145145

@@ -464,7 +464,7 @@ private static function getTableName($tableName): ?TableName
464464
{
465465
try {
466466
return TableName::fromValue($tableName);
467-
} catch (InvalidTableName $exception) {
467+
} catch (InvalidTableName) {
468468
return null;
469469
}
470470
}

‎libraries/classes/Controllers/Export/ExportController.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ public function __invoke(ServerRequest $request): void
486486
if (! $exportPlugin->exportFooter()) {
487487
throw new ExportException('Failure during footer export.');
488488
}
489-
} catch (ExportException $e) {
489+
} catch (ExportException) {
490490
// Ignore
491491
}
492492

‎libraries/classes/Controllers/Table/DropColumnConfirmationController.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function __invoke(ServerRequest $request): void
2828
$this->sendErrorResponse($exception->getMessage());
2929

3030
return;
31-
} catch (InvalidArgumentException $exception) {
31+
} catch (InvalidArgumentException) {
3232
$this->sendErrorResponse(__('No column selected.'));
3333

3434
return;

‎libraries/classes/Controllers/Table/TrackingController.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ private function validateDateTimeParam($param): DateTimeImmutable
295295
Assert::stringNotEmpty($param);
296296

297297
return new DateTimeImmutable($param);
298-
} catch (Throwable $exception) {
298+
} catch (Throwable) {
299299
return new DateTimeImmutable();
300300
}
301301
}

‎libraries/classes/Controllers/Transformation/WrapperController.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function __invoke(ServerRequest $request): void
6363
try {
6464
$db = DatabaseName::fromValue($request->getParam('db'));
6565
$table = TableName::fromValue($request->getParam('table'));
66-
} catch (InvalidIdentifierName $exception) {
66+
} catch (InvalidIdentifierName) {
6767
return;
6868
}
6969

‎libraries/classes/Crypto/Crypto.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function decrypt(string $encrypted): ?string
5454
$ciphertext = mb_substr($encrypted, SODIUM_CRYPTO_SECRETBOX_NONCEBYTES, null, '8bit');
5555
try {
5656
$decrypted = sodium_crypto_secretbox_open($ciphertext, $nonce, $key);
57-
} catch (Throwable $e) {
57+
} catch (Throwable) {
5858
return null;
5959
}
6060

‎libraries/classes/Dbal/DatabaseName.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@ private function __construct($name)
3434
{
3535
try {
3636
Assert::stringNotEmpty($name);
37-
} catch (InvalidArgumentException $exception) {
37+
} catch (InvalidArgumentException) {
3838
throw InvalidDatabaseName::fromEmptyName();
3939
}
4040

4141
try {
4242
Assert::maxLength($name, self::MAX_LENGTH);
43-
} catch (InvalidArgumentException $exception) {
43+
} catch (InvalidArgumentException) {
4444
throw InvalidDatabaseName::fromLongName(self::MAX_LENGTH);
4545
}
4646

4747
try {
4848
Assert::notEndsWith($name, ' ');
49-
} catch (InvalidArgumentException $exception) {
49+
} catch (InvalidArgumentException) {
5050
throw InvalidDatabaseName::fromNameWithTrailingSpace();
5151
}
5252

@@ -70,7 +70,7 @@ public static function tryFromValue($name): ?self
7070
{
7171
try {
7272
return new self($name);
73-
} catch (InvalidDatabaseName $exception) {
73+
} catch (InvalidDatabaseName) {
7474
return null;
7575
}
7676
}

‎libraries/classes/Dbal/DbiMysqli.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function connect(string $user, string $password, Server $server): ?Connec
105105
$server->socket,
106106
$client_flags
107107
);
108-
} catch (mysqli_sql_exception $exception) {
108+
} catch (mysqli_sql_exception) {
109109
/**
110110
* Switch to SSL if server asked us to do so, unfortunately
111111
* there are more ways MySQL server can tell this:

‎libraries/classes/Dbal/TableName.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@ private function __construct($name)
3434
{
3535
try {
3636
Assert::stringNotEmpty($name);
37-
} catch (InvalidArgumentException $exception) {
37+
} catch (InvalidArgumentException) {
3838
throw InvalidTableName::fromEmptyName();
3939
}
4040

4141
try {
4242
Assert::maxLength($name, self::MAX_LENGTH);
43-
} catch (InvalidArgumentException $exception) {
43+
} catch (InvalidArgumentException) {
4444
throw InvalidTableName::fromLongName(self::MAX_LENGTH);
4545
}
4646

4747
try {
4848
Assert::notEndsWith($name, ' ');
49-
} catch (InvalidArgumentException $exception) {
49+
} catch (InvalidArgumentException) {
5050
throw InvalidTableName::fromNameWithTrailingSpace();
5151
}
5252

@@ -70,7 +70,7 @@ public static function tryFromValue($name): ?self
7070
{
7171
try {
7272
return new self($name);
73-
} catch (InvalidTableName $exception) {
73+
} catch (InvalidTableName) {
7474
return null;
7575
}
7676
}

0 commit comments

Comments
 (0)