Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.

Commit 39fae4d

Browse files
author
Hugo Hamon
committed
[Security] removed useless else condition in SwitchUserListener class.
1 parent 9aab396 commit 39fae4d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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)