Skip to content

Commit 103d3e7

Browse files
committed
Leverage non-capturing catches
1 parent ecad4f6 commit 103d3e7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Security/CheckLdapCredentialsListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function onCheckPassport(CheckPassportEvent $event)
7777
if ('' !== $ldapBadge->getSearchDn() && '' !== $ldapBadge->getSearchPassword()) {
7878
try {
7979
$ldap->bind($ldapBadge->getSearchDn(), $ldapBadge->getSearchPassword());
80-
} catch (InvalidCredentialsException $e) {
80+
} catch (InvalidCredentialsException) {
8181
throw new InvalidSearchCredentialsException();
8282
}
8383
} else {
@@ -97,7 +97,7 @@ public function onCheckPassport(CheckPassportEvent $event)
9797
}
9898

9999
$ldap->bind($dn, $presentedPassword);
100-
} catch (InvalidCredentialsException $e) {
100+
} catch (InvalidCredentialsException) {
101101
throw new BadCredentialsException('The presented password is invalid.');
102102
}
103103

Security/LdapUserProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function loadUserByIdentifier(string $identifier): UserInterface
7676
{
7777
try {
7878
$this->ldap->bind($this->searchDn, $this->searchPassword);
79-
} catch (InvalidCredentialsException $e) {
79+
} catch (InvalidCredentialsException) {
8080
throw new InvalidSearchCredentialsException();
8181
}
8282

@@ -107,7 +107,7 @@ public function loadUserByIdentifier(string $identifier): UserInterface
107107
if (null !== $this->uidKey) {
108108
$identifier = $this->getAttributeValue($entry, $this->uidKey);
109109
}
110-
} catch (InvalidArgumentException $e) {
110+
} catch (InvalidArgumentException) {
111111
}
112112

113113
return $this->loadUser($identifier, $entry);
@@ -144,7 +144,7 @@ public function upgradePassword(PasswordAuthenticatedUserInterface $user, string
144144
$user->getEntry()->setAttribute($this->passwordAttribute, [$newHashedPassword]);
145145
$this->ldap->getEntryManager()->update($user->getEntry());
146146
$user->setPassword($newHashedPassword);
147-
} catch (ExceptionInterface $e) {
147+
} catch (ExceptionInterface) {
148148
// ignore failed password upgrades
149149
}
150150
}

0 commit comments

Comments
 (0)