summaryrefslogtreecommitdiffstats
path: root/Core/Authentication
diff options
context:
space:
mode:
authorJavier Eguiluz <javier.eguiluz@gmail.com>2015-06-10 20:30:03 +0200
committerFabien Potencier <fabien.potencier@gmail.com>2015-06-15 18:26:34 +0200
commit36cde602d02d84b7a176912a8e01ed8e3c7ab85c (patch)
tree72b9f8f8c1a0dd48b833ebcf77da14b19d569b4d /Core/Authentication
parent86642118470f5301b4e29b8fb7d3dfe876c2e83e (diff)
downloadsymfony-security-36cde602d02d84b7a176912a8e01ed8e3c7ab85c.zip
symfony-security-36cde602d02d84b7a176912a8e01ed8e3c7ab85c.tar.gz
symfony-security-36cde602d02d84b7a176912a8e01ed8e3c7ab85c.tar.bz2
Standardize the name of the exception variables
Diffstat (limited to 'Core/Authentication')
-rw-r--r--Core/Authentication/Provider/DaoAuthenticationProvider.php14
-rw-r--r--Core/Authentication/Provider/UserAuthenticationProvider.php8
2 files changed, 11 insertions, 11 deletions
diff --git a/Core/Authentication/Provider/DaoAuthenticationProvider.php b/Core/Authentication/Provider/DaoAuthenticationProvider.php
index b7b4917..90cba25 100644
--- a/Core/Authentication/Provider/DaoAuthenticationProvider.php
+++ b/Core/Authentication/Provider/DaoAuthenticationProvider.php
@@ -87,13 +87,13 @@ class DaoAuthenticationProvider extends UserAuthenticationProvider
}
return $user;
- } catch (UsernameNotFoundException $notFound) {
- $notFound->setUsername($username);
- throw $notFound;
- } catch (\Exception $repositoryProblem) {
- $ex = new AuthenticationServiceException($repositoryProblem->getMessage(), 0, $repositoryProblem);
- $ex->setToken($token);
- throw $ex;
+ } catch (UsernameNotFoundException $e) {
+ $e->setUsername($username);
+ throw $e;
+ } catch (\Exception $e) {
+ $e = new AuthenticationServiceException($e->getMessage(), 0, $e);
+ $e->setToken($token);
+ throw $e;
}
}
}
diff --git a/Core/Authentication/Provider/UserAuthenticationProvider.php b/Core/Authentication/Provider/UserAuthenticationProvider.php
index b948135..b65a16b 100644
--- a/Core/Authentication/Provider/UserAuthenticationProvider.php
+++ b/Core/Authentication/Provider/UserAuthenticationProvider.php
@@ -68,13 +68,13 @@ abstract class UserAuthenticationProvider implements AuthenticationProviderInter
try {
$user = $this->retrieveUser($username, $token);
- } catch (UsernameNotFoundException $notFound) {
+ } catch (UsernameNotFoundException $e) {
if ($this->hideUserNotFoundExceptions) {
- throw new BadCredentialsException('Bad credentials', 0, $notFound);
+ throw new BadCredentialsException('Bad credentials', 0, $e);
}
- $notFound->setUsername($username);
+ $e->setUsername($username);
- throw $notFound;
+ throw $e;
}
if (!$user instanceof UserInterface) {