diff options
Diffstat (limited to 'Core')
-rw-r--r-- | Core/Authentication/Provider/DaoAuthenticationProvider.php | 3 | ||||
-rw-r--r-- | Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php | 1 | ||||
-rw-r--r-- | Core/Authentication/Provider/RememberMeAuthenticationProvider.php | 1 | ||||
-rw-r--r-- | Core/Authentication/Provider/UserAuthenticationProvider.php | 2 | ||||
-rw-r--r-- | Core/Authentication/RememberMe/TokenProviderInterface.php | 11 | ||||
-rw-r--r-- | Core/Authentication/Token/AnonymousToken.php | 1 | ||||
-rw-r--r-- | Core/Authentication/Token/RememberMeToken.php | 3 | ||||
-rw-r--r-- | Core/Authorization/Voter/VoterInterface.php | 2 | ||||
-rw-r--r-- | Core/Encoder/EncoderFactory.php | 1 | ||||
-rw-r--r-- | Core/Encoder/EncoderFactoryInterface.php | 3 | ||||
-rw-r--r-- | Core/Exception/NonceExpiredException.php | 3 | ||||
-rw-r--r-- | Core/SecurityContext.php | 10 | ||||
-rw-r--r-- | Core/SecurityContextInterface.php | 2 | ||||
-rw-r--r-- | Core/User/ChainUserProvider.php | 2 | ||||
-rw-r--r-- | Core/User/UserCheckerInterface.php | 4 | ||||
-rw-r--r-- | Core/User/UserInterface.php | 1 |
16 files changed, 28 insertions, 22 deletions
diff --git a/Core/Authentication/Provider/DaoAuthenticationProvider.php b/Core/Authentication/Provider/DaoAuthenticationProvider.php index f9e8b38..f17eaa4 100644 --- a/Core/Authentication/Provider/DaoAuthenticationProvider.php +++ b/Core/Authentication/Provider/DaoAuthenticationProvider.php @@ -11,7 +11,6 @@ namespace Symfony\Component\Security\Core\Authentication\Provider; -use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface; use Symfony\Component\Security\Core\User\UserProviderInterface; use Symfony\Component\Security\Core\User\UserCheckerInterface; @@ -84,7 +83,7 @@ class DaoAuthenticationProvider extends UserAuthenticationProvider $user = $this->userProvider->loadUserByUsername($username); if (!$user instanceof UserInterface) { - throw new AuthenticationServiceException('The user provider must return an UserInterface object.'); + throw new AuthenticationServiceException('The user provider must return a UserInterface object.'); } return $user; diff --git a/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php b/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php index e4bf963..3affd78 100644 --- a/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php +++ b/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php @@ -11,7 +11,6 @@ namespace Symfony\Component\Security\Core\Authentication\Provider; -use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\User\UserProviderInterface; use Symfony\Component\Security\Core\User\UserCheckerInterface; use Symfony\Component\Security\Core\Exception\BadCredentialsException; diff --git a/Core/Authentication/Provider/RememberMeAuthenticationProvider.php b/Core/Authentication/Provider/RememberMeAuthenticationProvider.php index fb687b2..b7f3125 100644 --- a/Core/Authentication/Provider/RememberMeAuthenticationProvider.php +++ b/Core/Authentication/Provider/RememberMeAuthenticationProvider.php @@ -12,7 +12,6 @@ namespace Symfony\Component\Security\Core\Authentication\Provider; use Symfony\Component\Security\Core\User\UserCheckerInterface; -use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authentication\Token\RememberMeToken; use Symfony\Component\Security\Core\Exception\BadCredentialsException; diff --git a/Core/Authentication/Provider/UserAuthenticationProvider.php b/Core/Authentication/Provider/UserAuthenticationProvider.php index 8183c62..ce78df6 100644 --- a/Core/Authentication/Provider/UserAuthenticationProvider.php +++ b/Core/Authentication/Provider/UserAuthenticationProvider.php @@ -67,7 +67,7 @@ abstract class UserAuthenticationProvider implements AuthenticationProviderInter $user = $this->retrieveUser($username, $token); if (!$user instanceof UserInterface) { - throw new AuthenticationServiceException('retrieveUser() must return an UserInterface.'); + throw new AuthenticationServiceException('retrieveUser() must return a UserInterface.'); } $this->userChecker->checkPreAuth($user); diff --git a/Core/Authentication/RememberMe/TokenProviderInterface.php b/Core/Authentication/RememberMe/TokenProviderInterface.php index b48bd4d..7f86e4e 100644 --- a/Core/Authentication/RememberMe/TokenProviderInterface.php +++ b/Core/Authentication/RememberMe/TokenProviderInterface.php @@ -19,23 +19,25 @@ namespace Symfony\Component\Security\Core\Authentication\RememberMe; interface TokenProviderInterface { /** - * Loads the active token for the given series + * Loads the active token for the given series. * * @throws TokenNotFoundException if the token is not found * * @param string $series + * * @return PersistentTokenInterface */ function loadTokenBySeries($series); /** - * Deletes all tokens belonging to series + * Deletes all tokens belonging to series. + * * @param string $series */ function deleteTokenBySeries($series); /** - * Updates the token according to this data + * Updates the token according to this data. * * @param string $series * @param string $tokenValue @@ -44,7 +46,8 @@ interface TokenProviderInterface function updateToken($series, $tokenValue, \DateTime $lastUsed); /** - * Creates a new token + * Creates a new token. + * * @param PersistentTokenInterface $token */ function createNewToken(PersistentTokenInterface $token); diff --git a/Core/Authentication/Token/AnonymousToken.php b/Core/Authentication/Token/AnonymousToken.php index 92d95de..ecdd4cc 100644 --- a/Core/Authentication/Token/AnonymousToken.php +++ b/Core/Authentication/Token/AnonymousToken.php @@ -16,7 +16,6 @@ namespace Symfony\Component\Security\Core\Authentication\Token; * * @author Fabien Potencier <fabien@symfony.com> */ -use Symfony\Component\Security\Core\User\UserInterface; class AnonymousToken extends AbstractToken { diff --git a/Core/Authentication/Token/RememberMeToken.php b/Core/Authentication/Token/RememberMeToken.php index 81ab1c2..7ac9e1c 100644 --- a/Core/Authentication/Token/RememberMeToken.php +++ b/Core/Authentication/Token/RememberMeToken.php @@ -30,7 +30,8 @@ class RememberMeToken extends AbstractToken * @param string $providerKey * @param string $key */ - public function __construct(UserInterface $user, $providerKey, $key) { + public function __construct(UserInterface $user, $providerKey, $key) + { parent::__construct($user->getRoles()); if (empty($key)) { diff --git a/Core/Authorization/Voter/VoterInterface.php b/Core/Authorization/Voter/VoterInterface.php index b37880f..41d9e64 100644 --- a/Core/Authorization/Voter/VoterInterface.php +++ b/Core/Authorization/Voter/VoterInterface.php @@ -45,7 +45,7 @@ interface VoterInterface /** * Returns the vote for the given parameters. * - * This method must return one of the following constant: + * This method must return one of the following constants: * ACCESS_GRANTED, ACCESS_DENIED, or ACCESS_ABSTAIN. * * @param TokenInterface $token A TokenInterface instance diff --git a/Core/Encoder/EncoderFactory.php b/Core/Encoder/EncoderFactory.php index d7ae32d..738706a 100644 --- a/Core/Encoder/EncoderFactory.php +++ b/Core/Encoder/EncoderFactory.php @@ -51,6 +51,7 @@ class EncoderFactory implements EncoderFactoryInterface * Creates the actual encoder instance * * @param array $config + * * @return PasswordEncoderInterface */ private function createEncoder(array $config) diff --git a/Core/Encoder/EncoderFactoryInterface.php b/Core/Encoder/EncoderFactoryInterface.php index 811c262..3ae07e6 100644 --- a/Core/Encoder/EncoderFactoryInterface.php +++ b/Core/Encoder/EncoderFactoryInterface.php @@ -21,9 +21,10 @@ use Symfony\Component\Security\Core\User\UserInterface; interface EncoderFactoryInterface { /** - * Returns the password encoder to use for the given account + * Returns the password encoder to use for the given account. * * @param UserInterface $user + * * @return PasswordEncoderInterface never null */ function getEncoder(UserInterface $user); diff --git a/Core/Exception/NonceExpiredException.php b/Core/Exception/NonceExpiredException.php index 72b6d57..6a6a781 100644 --- a/Core/Exception/NonceExpiredException.php +++ b/Core/Exception/NonceExpiredException.php @@ -12,9 +12,6 @@ namespace Symfony\Component\Security\Core\Exception; use Symfony\Component\Security\Core\Exception\AuthenticationException; -use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Log\LoggerInterface; /** * NonceExpiredException is thrown when an authentication is rejected because diff --git a/Core/SecurityContext.php b/Core/SecurityContext.php index c492339..0623140 100644 --- a/Core/SecurityContext.php +++ b/Core/SecurityContext.php @@ -11,12 +11,10 @@ namespace Symfony\Component\Security\Core; -use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException; use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface; use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; -use Symfony\Component\Security\Acl\Voter\FieldVote; /** * SecurityContext is the main entry point of the Security component. @@ -51,8 +49,10 @@ class SecurityContext implements SecurityContextInterface * Checks if the attributes are granted against the current token. * * @throws AuthenticationCredentialsNotFoundException when the security context has no authentication token. + * * @param mixed $attributes * @param mixed|null $object + * * @return Boolean */ public final function isGranted($attributes, $object = null) @@ -65,7 +65,11 @@ class SecurityContext implements SecurityContextInterface $this->token = $this->authenticationManager->authenticate($this->token); } - return $this->accessDecisionManager->decide($this->token, (array) $attributes, $object); + if (!is_array($attributes)) { + $attributes = array($attributes); + } + + return $this->accessDecisionManager->decide($this->token, $attributes, $object); } /** diff --git a/Core/SecurityContextInterface.php b/Core/SecurityContextInterface.php index d57c409..46b2cc4 100644 --- a/Core/SecurityContextInterface.php +++ b/Core/SecurityContextInterface.php @@ -35,6 +35,7 @@ interface SecurityContextInterface * Sets the authentication token. * * @param TokenInterface $token + * * @return void */ function setToken(TokenInterface $token = null); @@ -44,6 +45,7 @@ interface SecurityContextInterface * * @param array $attributes * @param mixed $object + * * @return Boolean */ function isGranted($attributes, $object = null); diff --git a/Core/User/ChainUserProvider.php b/Core/User/ChainUserProvider.php index b0556f7..14a0dec 100644 --- a/Core/User/ChainUserProvider.php +++ b/Core/User/ChainUserProvider.php @@ -64,7 +64,7 @@ class ChainUserProvider implements UserProviderInterface // try next one } } - + if ($supportedUserFound) { throw new UsernameNotFoundException(sprintf('There is no user with name "%s".', $user->getUsername())); } else { diff --git a/Core/User/UserCheckerInterface.php b/Core/User/UserCheckerInterface.php index 25de94a..61f0f6e 100644 --- a/Core/User/UserCheckerInterface.php +++ b/Core/User/UserCheckerInterface.php @@ -23,14 +23,14 @@ interface UserCheckerInterface /** * Checks the user account before authentication. * - * @param UserInterface $user An UserInterface instance + * @param UserInterface $user a UserInterface instance */ function checkPreAuth(UserInterface $user); /** * Checks the user account after authentication. * - * @param UserInterface $user An UserInterface instance + * @param UserInterface $user a UserInterface instance */ function checkPostAuth(UserInterface $user); } diff --git a/Core/User/UserInterface.php b/Core/User/UserInterface.php index 9091bfc..3b66956 100644 --- a/Core/User/UserInterface.php +++ b/Core/User/UserInterface.php @@ -61,6 +61,7 @@ interface UserInterface * are relevant for assessing whether re-authentication is required. * * @param UserInterface $user + * * @return Boolean */ function equals(UserInterface $user); |