minor #15333 [Security] removed useless else condition in SwitchUserListener class. (hhamon)

This PR was merged into the 2.3 branch.

Discussion
----------

[Security] removed useless else condition in SwitchUserListener class.

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ~
| License       | MIT
| Doc PR        |  ~

Commits
-------

1fc0315 [Security] removed useless else condition in SwitchUserListener class.
This commit is contained in:
Fabien Potencier 2015-07-23 04:13:32 +02:00
commit fa1ab249bc
1 changed files with 2 additions and 2 deletions

View File

@ -116,9 +116,9 @@ class SwitchUserListener implements ListenerInterface
if (false !== $originalToken) {
if ($token->getUsername() === $request->get($this->usernameParameter)) {
return $token;
} else {
throw new \LogicException(sprintf('You are already switched to "%s" user.', $token->getUsername()));
}
throw new \LogicException(sprintf('You are already switched to "%s" user.', $token->getUsername()));
}
if (false === $this->accessDecisionManager->decide($token, array($this->role))) {