Skip to content

Commit 8b44432

Browse files
committed
Leverage non-capturing catches
1 parent a36d9b0 commit 8b44432

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

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
}

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
}

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
}

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

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
}

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

0 commit comments

Comments
 (0)