summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Borreli <pascal@borreli.com>2011-02-27 18:29:01 +0100
committerPascal Borreli <pascal@borreli.com>2011-02-27 18:36:38 +0100
commitea6fe79cb3c5cfb29f2e35a561b080d0d42d188c (patch)
treea71386653b684ea0f785aacf08e004cfed086c50
parent1c18a5dc24b8bf3d20aefd2cf7dec02adafb47ac (diff)
downloadsymfony-security-ea6fe79cb3c5cfb29f2e35a561b080d0d42d188c.zip
symfony-security-ea6fe79cb3c5cfb29f2e35a561b080d0d42d188c.tar.gz
symfony-security-ea6fe79cb3c5cfb29f2e35a561b080d0d42d188c.tar.bz2
[Security] Removed useless else
-rw-r--r--Acl/Domain/PermissionGrantingStrategy.php4
-rw-r--r--Acl/Voter/AclVoter.php10
-rw-r--r--Core/Encoder/PlaintextPasswordEncoder.php4
-rw-r--r--Http/Firewall/AbstractAuthenticationListener.php14
4 files changed, 16 insertions, 16 deletions
diff --git a/Acl/Domain/PermissionGrantingStrategy.php b/Acl/Domain/PermissionGrantingStrategy.php
index d23dc3e..bbc5526 100644
--- a/Acl/Domain/PermissionGrantingStrategy.php
+++ b/Acl/Domain/PermissionGrantingStrategy.php
@@ -220,8 +220,8 @@ class PermissionGrantingStrategy implements PermissionGrantingStrategyInterface
return 0 !== ($ace->getMask() & $requiredMask);
} else if (self::EQUAL === $strategy) {
return $requiredMask === $ace->getMask();
- } else {
- throw new \RuntimeException(sprintf('The strategy "%s" is not supported.', $strategy));
}
+
+ throw new \RuntimeException(sprintf('The strategy "%s" is not supported.', $strategy));
}
}
diff --git a/Acl/Voter/AclVoter.php b/Acl/Voter/AclVoter.php
index 14acef5..d689db5 100644
--- a/Acl/Voter/AclVoter.php
+++ b/Acl/Voter/AclVoter.php
@@ -111,13 +111,13 @@ class AclVoter implements VoterInterface
}
return self::ACCESS_GRANTED;
- } else {
- if (null !== $this->logger) {
- $this->logger->debug('ACL found, insufficient permissions. Voting to deny access.');
- }
+ }
- return self::ACCESS_DENIED;
+ if (null !== $this->logger) {
+ $this->logger->debug('ACL found, insufficient permissions. Voting to deny access.');
}
+
+ return self::ACCESS_DENIED;
} catch (NoAceFoundException $noAce) {
if (null !== $this->logger) {
$this->logger->debug('ACL found, no ACE applicable. Voting to deny access.');
diff --git a/Core/Encoder/PlaintextPasswordEncoder.php b/Core/Encoder/PlaintextPasswordEncoder.php
index 98982b0..e155fbd 100644
--- a/Core/Encoder/PlaintextPasswordEncoder.php
+++ b/Core/Encoder/PlaintextPasswordEncoder.php
@@ -42,8 +42,8 @@ class PlaintextPasswordEncoder extends BasePasswordEncoder
if (!$this->ignorePasswordCase) {
return $this->comparePasswords($encoded, $pass2);
- } else {
- return $this->comparePasswords(strtolower($encoded), strtolower($pass2));
}
+
+ return $this->comparePasswords(strtolower($encoded), strtolower($pass2));
}
}
diff --git a/Http/Firewall/AbstractAuthenticationListener.php b/Http/Firewall/AbstractAuthenticationListener.php
index 353185e..f992b98 100644
--- a/Http/Firewall/AbstractAuthenticationListener.php
+++ b/Http/Firewall/AbstractAuthenticationListener.php
@@ -198,15 +198,15 @@ abstract class AbstractAuthenticationListener implements ListenerInterface
$subRequest->attributes->set(SecurityContextInterface::AUTHENTICATION_ERROR, $failed);
return $event->getSubject()->handle($subRequest, HttpKernelInterface::SUB_REQUEST);
- } else {
- if (null !== $this->logger) {
- $this->logger->debug(sprintf('Redirecting to %s', $this->options['failure_path']));
- }
-
- $request->getSession()->set(SecurityContextInterface::AUTHENTICATION_ERROR, $failed);
+ }
- return new RedirectResponse(0 !== strpos($this->options['failure_path'], 'http') ? $request->getUriForPath($this->options['failure_path']) : $this->options['failure_path'], 302);
+ if (null !== $this->logger) {
+ $this->logger->debug(sprintf('Redirecting to %s', $this->options['failure_path']));
}
+
+ $request->getSession()->set(SecurityContextInterface::AUTHENTICATION_ERROR, $failed);
+
+ return new RedirectResponse(0 !== strpos($this->options['failure_path'], 'http') ? $request->getUriForPath($this->options['failure_path']) : $this->options['failure_path'], 302);
}
protected function onSuccess(EventInterface $event, Request $request, TokenInterface $token)