Skip to content

Commit 74c08c1

Browse files
committed
Leverage non-capturing catches
1 parent 5145ed4 commit 74c08c1

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

AppVariable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public function getFlashes(string|array $types = null): array
139139
if (null === $session = $this->getSession()) {
140140
return [];
141141
}
142-
} catch (\RuntimeException $e) {
142+
} catch (\RuntimeException) {
143143
return [];
144144
}
145145

DataCollector/TwigDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function lateCollect()
7171
if ($profile->isTemplate()) {
7272
try {
7373
$template = $this->twig->load($name = $profile->getName());
74-
} catch (LoaderError $e) {
74+
} catch (LoaderError) {
7575
$template = null;
7676
}
7777

Extension/SecurityExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function isGranted(mixed $role, mixed $object = null, string $field = nul
4646

4747
try {
4848
return $this->securityChecker->isGranted($role, $object);
49-
} catch (AuthenticationCredentialsNotFoundException $e) {
49+
} catch (AuthenticationCredentialsNotFoundException) {
5050
return false;
5151
}
5252
}

Mime/BodyRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ private function getFingerPrint(TemplatedEmail $message): string
8585
$payload = [$messageContext, $message->getTextTemplate(), $message->getHtmlTemplate()];
8686
try {
8787
$serialized = serialize($payload);
88-
} catch (\Exception $e) {
88+
} catch (\Exception) {
8989
// Serialization of 'Closure' is not allowed
9090
// Happens when context contain a closure, in that case, we assume that context always change.
9191
$serialized = random_bytes(8);

Translation/TwigExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function extract($resource, MessageCatalogue $catalogue)
5353
foreach ($this->extractFiles($resource) as $file) {
5454
try {
5555
$this->extractTemplate(file_get_contents($file->getPathname()), $catalogue);
56-
} catch (Error $e) {
56+
} catch (Error) {
5757
// ignore errors, these should be fixed by using the linter
5858
}
5959
}

0 commit comments

Comments
 (0)