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:
commit
fa1ab249bc
@ -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))) {
|
||||
|
Reference in New Issue
Block a user