summaryrefslogtreecommitdiffstats
path: root/Core/Authentication
diff options
context:
space:
mode:
authorNicolas Grekas <nicolas.grekas@gmail.com>2015-06-18 15:03:50 +0200
committerNicolas Grekas <nicolas.grekas@gmail.com>2015-06-18 15:03:50 +0200
commit75f6af14e12329fa92918ca9811dcf9d4016dba9 (patch)
treea06aae1e5362f8bae4d0d7fb952e2e30fe6f304c /Core/Authentication
parent6c71220d9a0f048d6cd091ea3c8aabfb12f62ff7 (diff)
parent8c1c6eff4059a084f7f60a13da604af074badd79 (diff)
downloadsymfony-security-75f6af14e12329fa92918ca9811dcf9d4016dba9.zip
symfony-security-75f6af14e12329fa92918ca9811dcf9d4016dba9.tar.gz
symfony-security-75f6af14e12329fa92918ca9811dcf9d4016dba9.tar.bz2
Merge branch '2.6' into 2.7
* 2.6: Add test for HHVM FatalErrors [2.6][Debug] Fix fatal-errors handling on HHVM [2.3][Debug] Fix fatal-errors handling on HHVM Standardize the name of the exception variables [2.3] Static Code Analysis for Components Remove duplicated paths Conflicts: src/Symfony/Component/Debug/ErrorHandler.php src/Symfony/Component/Security/Http/Firewall/BasicAuthenticationListener.php src/Symfony/Component/Security/Http/Firewall/ContextListener.php src/Symfony/Component/Security/Http/Firewall/RememberMeListener.php src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeServices.php
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 55ebed4..ded53e4 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) {