Skip to content

Commit fa1ab24

Browse files
committed
minor symfony#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.
2 parents 18fe999 + 1fc0315 commit fa1ab24

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Security/Http/Firewall/SwitchUserListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ private function attemptSwitchUser(Request $request)
116116
if (false !== $originalToken) {
117117
if ($token->getUsername() === $request->get($this->usernameParameter)) {
118118
return $token;
119-
} else {
120-
throw new \LogicException(sprintf('You are already switched to "%s" user.', $token->getUsername()));
121119
}
120+
121+
throw new \LogicException(sprintf('You are already switched to "%s" user.', $token->getUsername()));
122122
}
123123

124124
if (false === $this->accessDecisionManager->decide($token, array($this->role))) {

0 commit comments

Comments
 (0)