diff options
author | Javier Eguiluz <javier.eguiluz@gmail.com> | 2015-06-10 20:30:03 +0200 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2015-06-15 18:26:34 +0200 |
commit | 36cde602d02d84b7a176912a8e01ed8e3c7ab85c (patch) | |
tree | 72b9f8f8c1a0dd48b833ebcf77da14b19d569b4d /Http/Firewall | |
parent | 86642118470f5301b4e29b8fb7d3dfe876c2e83e (diff) | |
download | symfony-security-36cde602d02d84b7a176912a8e01ed8e3c7ab85c.zip symfony-security-36cde602d02d84b7a176912a8e01ed8e3c7ab85c.tar.gz symfony-security-36cde602d02d84b7a176912a8e01ed8e3c7ab85c.tar.bz2 |
Standardize the name of the exception variables
Diffstat (limited to 'Http/Firewall')
-rw-r--r-- | Http/Firewall/AbstractPreAuthenticatedListener.php | 8 | ||||
-rw-r--r-- | Http/Firewall/BasicAuthenticationListener.php | 6 | ||||
-rw-r--r-- | Http/Firewall/ContextListener.php | 6 | ||||
-rw-r--r-- | Http/Firewall/DigestAuthenticationListener.php | 2 | ||||
-rw-r--r-- | Http/Firewall/RememberMeListener.php | 4 |
5 files changed, 13 insertions, 13 deletions
diff --git a/Http/Firewall/AbstractPreAuthenticatedListener.php b/Http/Firewall/AbstractPreAuthenticatedListener.php index f040107..9973683 100644 --- a/Http/Firewall/AbstractPreAuthenticatedListener.php +++ b/Http/Firewall/AbstractPreAuthenticatedListener.php @@ -62,8 +62,8 @@ abstract class AbstractPreAuthenticatedListener implements ListenerInterface try { list($user, $credentials) = $this->getPreAuthenticatedData($request); - } catch (BadCredentialsException $exception) { - $this->clearToken($exception); + } catch (BadCredentialsException $e) { + $this->clearToken($e); return; } @@ -90,8 +90,8 @@ abstract class AbstractPreAuthenticatedListener implements ListenerInterface $loginEvent = new InteractiveLoginEvent($request, $token); $this->dispatcher->dispatch(SecurityEvents::INTERACTIVE_LOGIN, $loginEvent); } - } catch (AuthenticationException $failed) { - $this->clearToken($failed); + } catch (AuthenticationException $e) { + $this->clearToken($e); } } diff --git a/Http/Firewall/BasicAuthenticationListener.php b/Http/Firewall/BasicAuthenticationListener.php index bfc4abc..eed9838 100644 --- a/Http/Firewall/BasicAuthenticationListener.php +++ b/Http/Firewall/BasicAuthenticationListener.php @@ -73,21 +73,21 @@ class BasicAuthenticationListener implements ListenerInterface try { $token = $this->authenticationManager->authenticate(new UsernamePasswordToken($username, $request->headers->get('PHP_AUTH_PW'), $this->providerKey)); $this->securityContext->setToken($token); - } catch (AuthenticationException $failed) { + } catch (AuthenticationException $e) { $token = $this->securityContext->getToken(); if ($token instanceof UsernamePasswordToken && $this->providerKey === $token->getProviderKey()) { $this->securityContext->setToken(null); } if (null !== $this->logger) { - $this->logger->info(sprintf('Authentication request failed for user "%s": %s', $username, $failed->getMessage())); + $this->logger->info(sprintf('Authentication request failed for user "%s": %s', $username, $e->getMessage())); } if ($this->ignoreFailure) { return; } - $event->setResponse($this->authenticationEntryPoint->start($request, $failed)); + $event->setResponse($this->authenticationEntryPoint->start($request, $e)); } } } diff --git a/Http/Firewall/ContextListener.php b/Http/Firewall/ContextListener.php index c80fff3..43ad31d 100644 --- a/Http/Firewall/ContextListener.php +++ b/Http/Firewall/ContextListener.php @@ -167,11 +167,11 @@ class ContextListener implements ListenerInterface } return $token; - } catch (UnsupportedUserException $unsupported) { + } catch (UnsupportedUserException $e) { // let's try the next user provider - } catch (UsernameNotFoundException $notFound) { + } catch (UsernameNotFoundException $e) { if (null !== $this->logger) { - $this->logger->warning(sprintf('Username "%s" could not be found.', $notFound->getUsername())); + $this->logger->warning(sprintf('Username "%s" could not be found.', $e->getUsername())); } return; diff --git a/Http/Firewall/DigestAuthenticationListener.php b/Http/Firewall/DigestAuthenticationListener.php index 358c3c7..2737069 100644 --- a/Http/Firewall/DigestAuthenticationListener.php +++ b/Http/Firewall/DigestAuthenticationListener.php @@ -93,7 +93,7 @@ class DigestAuthenticationListener implements ListenerInterface } $serverDigestMd5 = $digestAuth->calculateServerDigest($user->getPassword(), $request->getMethod()); - } catch (UsernameNotFoundException $notFound) { + } catch (UsernameNotFoundException $e) { $this->fail($event, $request, new BadCredentialsException(sprintf('Username %s not found.', $digestAuth->getUsername()))); return; diff --git a/Http/Firewall/RememberMeListener.php b/Http/Firewall/RememberMeListener.php index beacff3..942e537 100644 --- a/Http/Firewall/RememberMeListener.php +++ b/Http/Firewall/RememberMeListener.php @@ -80,12 +80,12 @@ class RememberMeListener implements ListenerInterface if (null !== $this->logger) { $this->logger->debug('SecurityContext populated with remember-me token.'); } - } catch (AuthenticationException $failed) { + } catch (AuthenticationException $e) { if (null !== $this->logger) { $this->logger->warning( 'SecurityContext not populated with remember-me token as the' .' AuthenticationManager rejected the AuthenticationToken returned' - .' by the RememberMeServices: '.$failed->getMessage() + .' by the RememberMeServices: '.$e->getMessage() ); } |