Skip to content

Commit 3d00baf

Browse files
committed
minor symfony#45902 Leverage non-capturing catches (fancyweb)
This PR was merged into the 6.1 branch. Discussion ---------- Leverage non-capturing catches | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Commits ------- 9c3bdb7 Leverage non-capturing catches
2 parents 9fbe216 + 9c3bdb7 commit 3d00baf

File tree

171 files changed

+283
-283
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+283
-283
lines changed

src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,9 @@ protected function getMetadata(string $class)
176176
foreach ($this->registry->getManagers() as $name => $em) {
177177
try {
178178
return $this->cache[$class] = [$em->getClassMetadata($class), $name];
179-
} catch (MappingException $e) {
179+
} catch (MappingException) {
180180
// not an entity or mapped super class
181-
} catch (LegacyMappingException $e) {
181+
} catch (LegacyMappingException) {
182182
// not an entity or mapped super class, using Doctrine ORM 2.2
183183
}
184184
}

src/Symfony/Bridge/Doctrine/Messenger/DoctrinePingConnectionMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ private function pingConnection(EntityManagerInterface $entityManager)
3939

4040
try {
4141
$connection->executeQuery($connection->getDatabasePlatform()->getDummySelectSQL());
42-
} catch (DBALException $e) {
42+
} catch (DBALException) {
4343
$connection->close();
4444
$connection->connect();
4545
}

src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ private function getMetadata(string $class): ?ClassMetadata
212212
{
213213
try {
214214
return $this->entityManager->getClassMetadata($class);
215-
} catch (MappingException|OrmMappingException $exception) {
215+
} catch (MappingException|OrmMappingException) {
216216
return null;
217217
}
218218
}

src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public function verifyToken(PersistentTokenInterface $token, string $tokenValue)
163163
// we also accept it as a valid value.
164164
try {
165165
$tmpToken = $this->loadTokenBySeries($tmpSeries);
166-
} catch (TokenNotFoundException $e) {
166+
} catch (TokenNotFoundException) {
167167
return false;
168168
}
169169

src/Symfony/Bridge/Doctrine/Types/AbstractUidType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): ?str
8080

8181
try {
8282
return $this->getUidClass()::fromString($value)->$toString();
83-
} catch (\InvalidArgumentException $e) {
83+
} catch (\InvalidArgumentException) {
8484
throw ConversionException::conversionFailed($value, $this->getName());
8585
}
8686
}

src/Symfony/Bridge/Doctrine/Validator/DoctrineLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function loadClassMetadata(ClassMetadata $metadata): bool
5050
$className = $metadata->getClassName();
5151
try {
5252
$doctrineMetadata = $this->entityManager->getClassMetadata($className);
53-
} catch (MappingException|OrmMappingException $exception) {
53+
} catch (MappingException|OrmMappingException) {
5454
return false;
5555
}
5656

src/Symfony/Bridge/Twig/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

src/Symfony/Bridge/Twig/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

src/Symfony/Bridge/Twig/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
}

src/Symfony/Bridge/Twig/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);

0 commit comments

Comments
 (0)