diff options
-rw-r--r-- | Acl/Dbal/AclProvider.php | 3 | ||||
-rw-r--r-- | Acl/Dbal/MutableAclProvider.php | 3 | ||||
-rw-r--r-- | Acl/Domain/PermissionGrantingStrategy.php | 4 | ||||
-rw-r--r-- | Acl/Voter/AclVoter.php | 10 | ||||
-rw-r--r-- | Core/Encoder/PlaintextPasswordEncoder.php | 4 | ||||
-rw-r--r-- | Core/Exception/NonceExpiredException.php | 2 | ||||
-rw-r--r-- | Http/Firewall/AbstractAuthenticationListener.php | 14 |
7 files changed, 19 insertions, 21 deletions
diff --git a/Acl/Dbal/AclProvider.php b/Acl/Dbal/AclProvider.php index c45a597..f883599 100644 --- a/Acl/Dbal/AclProvider.php +++ b/Acl/Dbal/AclProvider.php @@ -437,8 +437,7 @@ class AclProvider implements AclProviderInterface // fill-in parent ACLs where this hasn't been done yet cause the parent ACL was not // yet available $processed = 0; - foreach ($parentIdToFill as $acl) - { + foreach ($parentIdToFill as $acl) { $parentId = $parentIdToFill->offsetGet($acl); // let's see if we have already hydrated this diff --git a/Acl/Dbal/MutableAclProvider.php b/Acl/Dbal/MutableAclProvider.php index da5ded9..3a8eebc 100644 --- a/Acl/Dbal/MutableAclProvider.php +++ b/Acl/Dbal/MutableAclProvider.php @@ -860,8 +860,7 @@ QUERY; */ protected function updateAces(\SplObjectStorage $aces) { - foreach ($aces as $ace) - { + foreach ($aces as $ace) { $propertyChanges = $aces->offsetGet($ace); $sets = array(); 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/Core/Exception/NonceExpiredException.php b/Core/Exception/NonceExpiredException.php index 5544a63..34bb1dd 100644 --- a/Core/Exception/NonceExpiredException.php +++ b/Core/Exception/NonceExpiredException.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\Component\HttpKernel\Security\EntryPoint; +namespace Symfony\Component\Security\Core\Exception; use Symfony\Component\Security\Core\Exception\AuthenticationException; use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface; 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) |