summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Acl/Dbal/AclProvider.php42
-rw-r--r--Acl/Dbal/MutableAclProvider.php2
-rw-r--r--Acl/Domain/DoctrineAclCache.php2
-rw-r--r--Acl/Domain/ObjectIdentity.php4
-rw-r--r--Acl/Domain/PermissionGrantingStrategy.php2
-rw-r--r--Acl/Domain/UserSecurityIdentity.php2
-rw-r--r--Acl/Model/MutableAclInterface.php1
-rw-r--r--Acl/Permission/MaskBuilder.php8
-rw-r--r--Core/Authentication/AuthenticationProviderManager.php2
-rw-r--r--Core/Authentication/Provider/UserAuthenticationProvider.php2
-rw-r--r--Core/Authentication/RememberMe/PersistentToken.php2
-rw-r--r--Core/Authentication/Token/AbstractToken.php2
-rw-r--r--Core/Authentication/Token/RememberMeToken.php2
-rw-r--r--Core/Authorization/AccessDecisionManager.php2
-rw-r--r--Core/Encoder/BasePasswordEncoder.php2
-rw-r--r--Core/Encoder/EncoderFactory.php2
-rw-r--r--Core/User/InMemoryUserProvider.php2
-rw-r--r--Core/Util/StringUtils.php29
-rw-r--r--Http/Firewall/AbstractAuthenticationListener.php5
-rw-r--r--Http/Firewall/AccessListener.php3
-rw-r--r--Http/Firewall/ContextListener.php2
-rw-r--r--Http/Firewall/DigestAuthenticationListener.php2
-rw-r--r--Http/Firewall/LogoutListener.php4
-rw-r--r--Http/Firewall/SwitchUserListener.php7
-rw-r--r--Http/HttpUtils.php17
-rw-r--r--Http/RememberMe/AbstractRememberMeServices.php6
-rw-r--r--LICENSE2
-rw-r--r--Tests/Acl/Dbal/AclProviderTest.php2
-rw-r--r--Tests/Acl/Dbal/MutableAclProviderTest.php2
-rw-r--r--Tests/Acl/Domain/PermissionGrantingStrategyTest.php2
-rw-r--r--Tests/Core/Authentication/Provider/AnonymousAuthenticationProviderTest.php2
-rw-r--r--Tests/Core/Authentication/Provider/DaoAuthenticationProviderTest.php12
-rw-r--r--Tests/Core/Authentication/Provider/PreAuthenticatedAuthenticationProviderTest.php4
-rw-r--r--Tests/Core/Authentication/Provider/RememberMeAuthenticationProviderTest.php4
-rw-r--r--Tests/Core/Authentication/Provider/UserAuthenticationProviderTest.php14
-rw-r--r--Tests/Core/Authentication/RememberMe/InMemoryTokenProviderTest.php4
-rw-r--r--Tests/Core/SecurityContextTest.php2
-rw-r--r--Tests/Core/User/AccountCheckerTest.php8
-rw-r--r--Tests/Core/User/ChainUserProviderTest.php4
-rw-r--r--Tests/Core/User/InMemoryProviderTest.php2
-rw-r--r--Tests/Core/Util/ClassUtilsTest.php2
-rw-r--r--Tests/Http/Firewall/AccessListenerTest.php4
-rw-r--r--Tests/Http/Firewall/ContextListenerTest.php2
-rw-r--r--Tests/Http/Firewall/LogoutListenerTest.php2
44 files changed, 168 insertions, 62 deletions
diff --git a/Acl/Dbal/AclProvider.php b/Acl/Dbal/AclProvider.php
index ada4f22..6f47231 100644
--- a/Acl/Dbal/AclProvider.php
+++ b/Acl/Dbal/AclProvider.php
@@ -258,16 +258,40 @@ SELECTCLAUSE;
WHERE (
SELECTCLAUSE;
- $where = '(o.object_identifier = %s AND c.class_type = %s)';
- for ($i=0,$c=count($batch); $i<$c; $i++) {
+ $types = array();
+ $count = count($batch);
+ for ($i = 0; $i < $count; $i++) {
+ if (!isset($types[$batch[$i]->getType()])) {
+ $types[$batch[$i]->getType()] = true;
+ if ($count > 1) {
+ break;
+ }
+ }
+ }
+
+ if (1 === count($types)) {
+ $ids = array();
+ for ($i = 0; $i < $count; $i++) {
+ $ids[] = $this->connection->quote($batch[$i]->getIdentifier());
+ }
+
$sql .= sprintf(
- $where,
- $this->connection->quote($batch[$i]->getIdentifier()),
- $this->connection->quote($batch[$i]->getType())
+ '(o.object_identifier IN (%s) AND c.class_type = %s)',
+ implode(',', $ids),
+ $this->connection->quote($batch[0]->getType())
);
-
- if ($i+1 < $c) {
- $sql .= ' OR ';
+ } else {
+ $where = '(o.object_identifier = %s AND c.class_type = %s)';
+ for ($i = 0; $i < $count; $i++) {
+ $sql .= sprintf(
+ $where,
+ $this->connection->quote($batch[$i]->getIdentifier()),
+ $this->connection->quote($batch[$i]->getType())
+ );
+
+ if ($i+1 < $count) {
+ $sql .= ' OR ';
+ }
}
}
@@ -417,6 +441,8 @@ QUERY;
* @param array $oidLookup
*
* @return \SplObjectStorage mapping object identities to ACL instances
+ *
+ * @throws AclNotFoundException
*/
private function lookupObjectIdentities(array $batch, array $sids, array $oidLookup)
{
diff --git a/Acl/Dbal/MutableAclProvider.php b/Acl/Dbal/MutableAclProvider.php
index 9a20f61..0ac4fa7 100644
--- a/Acl/Dbal/MutableAclProvider.php
+++ b/Acl/Dbal/MutableAclProvider.php
@@ -147,6 +147,8 @@ class MutableAclProvider extends AclProvider implements MutableAclProviderInterf
* @param string $propertyName
* @param mixed $oldValue
* @param mixed $newValue
+ *
+ * @throws \InvalidArgumentException
*/
public function propertyChanged($sender, $propertyName, $oldValue, $newValue)
{
diff --git a/Acl/Domain/DoctrineAclCache.php b/Acl/Domain/DoctrineAclCache.php
index 731f98c..bfc5452 100644
--- a/Acl/Domain/DoctrineAclCache.php
+++ b/Acl/Domain/DoctrineAclCache.php
@@ -36,6 +36,8 @@ class DoctrineAclCache implements AclCacheInterface
* @param Cache $cache
* @param PermissionGrantingStrategyInterface $permissionGrantingStrategy
* @param string $prefix
+ *
+ * @throws \InvalidArgumentException
*/
public function __construct(Cache $cache, PermissionGrantingStrategyInterface $permissionGrantingStrategy, $prefix = self::PREFIX)
{
diff --git a/Acl/Domain/ObjectIdentity.php b/Acl/Domain/ObjectIdentity.php
index da98f5e..d7d5f84 100644
--- a/Acl/Domain/ObjectIdentity.php
+++ b/Acl/Domain/ObjectIdentity.php
@@ -31,6 +31,8 @@ final class ObjectIdentity implements ObjectIdentityInterface
*
* @param string $identifier
* @param string $type
+ *
+ * @throws \InvalidArgumentException
*/
public function __construct($identifier, $type)
{
@@ -49,7 +51,7 @@ final class ObjectIdentity implements ObjectIdentityInterface
* Constructs an ObjectIdentity for the given domain object
*
* @param object $domainObject
- * @throws \InvalidArgumentException
+ * @throws InvalidDomainObjectException
* @return ObjectIdentity
*/
public static function fromDomainObject($domainObject)
diff --git a/Acl/Domain/PermissionGrantingStrategy.php b/Acl/Domain/PermissionGrantingStrategy.php
index e075861..d505843 100644
--- a/Acl/Domain/PermissionGrantingStrategy.php
+++ b/Acl/Domain/PermissionGrantingStrategy.php
@@ -131,6 +131,8 @@ class PermissionGrantingStrategy implements PermissionGrantingStrategyInterface
* @param Boolean $administrativeMode True turns off audit logging
*
* @return Boolean true, or false; either granting, or denying access respectively.
+ *
+ * @throws NoAceFoundException
*/
private function hasSufficientPermissions(AclInterface $acl, array $aces, array $masks, array $sids, $administrativeMode)
{
diff --git a/Acl/Domain/UserSecurityIdentity.php b/Acl/Domain/UserSecurityIdentity.php
index ebb0056..3166a1a 100644
--- a/Acl/Domain/UserSecurityIdentity.php
+++ b/Acl/Domain/UserSecurityIdentity.php
@@ -31,6 +31,8 @@ final class UserSecurityIdentity implements SecurityIdentityInterface
*
* @param string $username the username representation
* @param string $class the user's fully qualified class name
+ *
+ * @throws \InvalidArgumentException
*/
public function __construct($username, $class)
{
diff --git a/Acl/Model/MutableAclInterface.php b/Acl/Model/MutableAclInterface.php
index 9028aa9..365a779 100644
--- a/Acl/Model/MutableAclInterface.php
+++ b/Acl/Model/MutableAclInterface.php
@@ -115,7 +115,6 @@ interface MutableAclInterface extends AclInterface
* Sets the parent ACL
*
* @param AclInterface|null $acl
- * @return void
*/
public function setParentAcl(AclInterface $acl = null);
diff --git a/Acl/Permission/MaskBuilder.php b/Acl/Permission/MaskBuilder.php
index df1fa7c..017e7c0 100644
--- a/Acl/Permission/MaskBuilder.php
+++ b/Acl/Permission/MaskBuilder.php
@@ -73,6 +73,8 @@ class MaskBuilder
* Constructor
*
* @param integer $mask optional; defaults to 0
+ *
+ * @throws \InvalidArgumentException
*/
public function __construct($mask = 0)
{
@@ -87,7 +89,10 @@ class MaskBuilder
* Adds a mask to the permission
*
* @param mixed $mask
+ *
* @return MaskBuilder
+ *
+ * @throws \InvalidArgumentException
*/
public function add($mask)
{
@@ -140,7 +145,10 @@ class MaskBuilder
* Removes a mask from the permission
*
* @param mixed $mask
+ *
* @return MaskBuilder
+ *
+ * @throws \InvalidArgumentException
*/
public function remove($mask)
{
diff --git a/Core/Authentication/AuthenticationProviderManager.php b/Core/Authentication/AuthenticationProviderManager.php
index 7ca46c0..b0414f0 100644
--- a/Core/Authentication/AuthenticationProviderManager.php
+++ b/Core/Authentication/AuthenticationProviderManager.php
@@ -39,6 +39,8 @@ class AuthenticationProviderManager implements AuthenticationManagerInterface
*
* @param AuthenticationProviderInterface[] $providers An array of AuthenticationProviderInterface instances
* @param Boolean $eraseCredentials Whether to erase credentials after authentication or not
+ *
+ * @throws \InvalidArgumentException
*/
public function __construct(array $providers, $eraseCredentials = true)
{
diff --git a/Core/Authentication/Provider/UserAuthenticationProvider.php b/Core/Authentication/Provider/UserAuthenticationProvider.php
index 32d7971..ed8f499 100644
--- a/Core/Authentication/Provider/UserAuthenticationProvider.php
+++ b/Core/Authentication/Provider/UserAuthenticationProvider.php
@@ -37,6 +37,8 @@ abstract class UserAuthenticationProvider implements AuthenticationProviderInter
* @param UserCheckerInterface $userChecker An UserCheckerInterface interface
* @param string $providerKey A provider key
* @param Boolean $hideUserNotFoundExceptions Whether to hide user not found exception or not
+ *
+ * @throws \InvalidArgumentException
*/
public function __construct(UserCheckerInterface $userChecker, $providerKey, $hideUserNotFoundExceptions = true)
{
diff --git a/Core/Authentication/RememberMe/PersistentToken.php b/Core/Authentication/RememberMe/PersistentToken.php
index 88b0413..f3f6858 100644
--- a/Core/Authentication/RememberMe/PersistentToken.php
+++ b/Core/Authentication/RememberMe/PersistentToken.php
@@ -32,6 +32,8 @@ final class PersistentToken implements PersistentTokenInterface
* @param string $series
* @param string $tokenValue
* @param \DateTime $lastUsed
+ *
+ * @throws \InvalidArgumentException
*/
public function __construct($class, $username, $series, $tokenValue, \DateTime $lastUsed)
{
diff --git a/Core/Authentication/Token/AbstractToken.php b/Core/Authentication/Token/AbstractToken.php
index 68cbb79..f21aa76 100644
--- a/Core/Authentication/Token/AbstractToken.php
+++ b/Core/Authentication/Token/AbstractToken.php
@@ -34,6 +34,8 @@ abstract class AbstractToken implements TokenInterface
* Constructor.
*
* @param RoleInterface[] $roles An array of roles
+ *
+ * @throws \InvalidArgumentException
*/
public function __construct(array $roles = array())
{
diff --git a/Core/Authentication/Token/RememberMeToken.php b/Core/Authentication/Token/RememberMeToken.php
index de50e5c..6f3d821 100644
--- a/Core/Authentication/Token/RememberMeToken.php
+++ b/Core/Authentication/Token/RememberMeToken.php
@@ -29,6 +29,8 @@ class RememberMeToken extends AbstractToken
* @param UserInterface $user
* @param string $providerKey
* @param string $key
+ *
+ * @throws \InvalidArgumentException
*/
public function __construct(UserInterface $user, $providerKey, $key)
{
diff --git a/Core/Authorization/AccessDecisionManager.php b/Core/Authorization/AccessDecisionManager.php
index a8bb5cf..6028c42 100644
--- a/Core/Authorization/AccessDecisionManager.php
+++ b/Core/Authorization/AccessDecisionManager.php
@@ -34,6 +34,8 @@ class AccessDecisionManager implements AccessDecisionManagerInterface
* @param string $strategy The vote strategy
* @param Boolean $allowIfAllAbstainDecisions Whether to grant access if all voters abstained or not
* @param Boolean $allowIfEqualGrantedDeniedDecisions Whether to grant access if result are equals
+ *
+ * @throws \InvalidArgumentException
*/
public function __construct(array $voters, $strategy = 'affirmative', $allowIfAllAbstainDecisions = false, $allowIfEqualGrantedDeniedDecisions = true)
{
diff --git a/Core/Encoder/BasePasswordEncoder.php b/Core/Encoder/BasePasswordEncoder.php
index 1ef134b..c26c9ce 100644
--- a/Core/Encoder/BasePasswordEncoder.php
+++ b/Core/Encoder/BasePasswordEncoder.php
@@ -52,6 +52,8 @@ abstract class BasePasswordEncoder implements PasswordEncoderInterface
* @param string $salt the salt to be used
*
* @return string a merged password and salt
+ *
+ * @throws \InvalidArgumentException
*/
protected function mergePasswordAndSalt($password, $salt)
{
diff --git a/Core/Encoder/EncoderFactory.php b/Core/Encoder/EncoderFactory.php
index 9429441..8bad61f 100644
--- a/Core/Encoder/EncoderFactory.php
+++ b/Core/Encoder/EncoderFactory.php
@@ -51,6 +51,8 @@ class EncoderFactory implements EncoderFactoryInterface
* @param array $config
*
* @return PasswordEncoderInterface
+ *
+ * @throws \InvalidArgumentException
*/
private function createEncoder(array $config)
{
diff --git a/Core/User/InMemoryUserProvider.php b/Core/User/InMemoryUserProvider.php
index eae2083..bd74804 100644
--- a/Core/User/InMemoryUserProvider.php
+++ b/Core/User/InMemoryUserProvider.php
@@ -50,6 +50,8 @@ class InMemoryUserProvider implements UserProviderInterface
* Adds a new User to the provider.
*
* @param UserInterface $user A UserInterface instance
+ *
+ * @throws \LogicException
*/
public function createUser(UserInterface $user)
{
diff --git a/Core/Util/StringUtils.php b/Core/Util/StringUtils.php
index d21efd3..2e8925d 100644
--- a/Core/Util/StringUtils.php
+++ b/Core/Util/StringUtils.php
@@ -28,22 +28,33 @@ class StringUtils
*
* This method implements a constant-time algorithm to compare strings.
*
- * @param string $str1 The first string
- * @param string $str2 The second string
+ * @param string $knownString The string of known length to compare against
+ * @param string $userInput The string that the user can control
*
* @return Boolean true if the two strings are the same, false otherwise
*/
- public static function equals($str1, $str2)
+ public static function equals($knownString, $userInput)
{
- if (strlen($str1) !== $c = strlen($str2)) {
- return false;
- }
+ // Prevent issues if string length is 0
+ $knownString .= chr(0);
+ $userInput .= chr(0);
+
+ $knownLen = strlen($knownString);
+ $userLen = strlen($userInput);
+
+ // Set the result to the difference between the lengths
+ $result = $knownLen - $userLen;
- $result = 0;
- for ($i = 0; $i < $c; $i++) {
- $result |= ord($str1[$i]) ^ ord($str2[$i]);
+ // Note that we ALWAYS iterate over the user-supplied length
+ // This is to prevent leaking length information
+ for ($i = 0; $i < $userLen; $i++) {
+ // Using % here is a trick to prevent notices
+ // It's safe, since if the lengths are different
+ // $result is already non-0
+ $result |= (ord($knownString[$i % $knownLen]) ^ ord($userInput[$i]));
}
+ // They are only identical strings if $result is exactly 0...
return 0 === $result;
}
}
diff --git a/Http/Firewall/AbstractAuthenticationListener.php b/Http/Firewall/AbstractAuthenticationListener.php
index 410fb73..087aa08 100644
--- a/Http/Firewall/AbstractAuthenticationListener.php
+++ b/Http/Firewall/AbstractAuthenticationListener.php
@@ -75,6 +75,8 @@ abstract class AbstractAuthenticationListener implements ListenerInterface
* successful, or failed authentication attempt
* @param LoggerInterface $logger A LoggerInterface instance
* @param EventDispatcherInterface $dispatcher An EventDispatcherInterface instance
+ *
+ * @throws \InvalidArgumentException
*/
public function __construct(SecurityContextInterface $securityContext, AuthenticationManagerInterface $authenticationManager, SessionAuthenticationStrategyInterface $sessionStrategy, HttpUtils $httpUtils, $providerKey, AuthenticationSuccessHandlerInterface $successHandler, AuthenticationFailureHandlerInterface $failureHandler, array $options = array(), LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null)
{
@@ -110,6 +112,9 @@ abstract class AbstractAuthenticationListener implements ListenerInterface
* Handles form based authentication.
*
* @param GetResponseEvent $event A GetResponseEvent instance
+ *
+ * @throws \RuntimeException
+ * @throws SessionUnavailableException
*/
final public function handle(GetResponseEvent $event)
{
diff --git a/Http/Firewall/AccessListener.php b/Http/Firewall/AccessListener.php
index 3e2d3a5..67766ef 100644
--- a/Http/Firewall/AccessListener.php
+++ b/Http/Firewall/AccessListener.php
@@ -46,6 +46,9 @@ class AccessListener implements ListenerInterface
* Handles access authorization.
*
* @param GetResponseEvent $event A GetResponseEvent instance
+ *
+ * @throws AccessDeniedException
+ * @throws AuthenticationCredentialsNotFoundException
*/
public function handle(GetResponseEvent $event)
{
diff --git a/Http/Firewall/ContextListener.php b/Http/Firewall/ContextListener.php
index fddd3c7..0b5c955 100644
--- a/Http/Firewall/ContextListener.php
+++ b/Http/Firewall/ContextListener.php
@@ -134,6 +134,8 @@ class ContextListener implements ListenerInterface
* @param TokenInterface $token
*
* @return TokenInterface|null
+ *
+ * @throws \RuntimeException
*/
private function refreshUser(TokenInterface $token)
{
diff --git a/Http/Firewall/DigestAuthenticationListener.php b/Http/Firewall/DigestAuthenticationListener.php
index 2bc4aa5..3c83c87 100644
--- a/Http/Firewall/DigestAuthenticationListener.php
+++ b/Http/Firewall/DigestAuthenticationListener.php
@@ -54,6 +54,8 @@ class DigestAuthenticationListener implements ListenerInterface
* Handles digest authentication.
*
* @param GetResponseEvent $event A GetResponseEvent instance
+ *
+ * @throws AuthenticationServiceException
*/
public function handle(GetResponseEvent $event)
{
diff --git a/Http/Firewall/LogoutListener.php b/Http/Firewall/LogoutListener.php
index 32a0511..ca2f439 100644
--- a/Http/Firewall/LogoutListener.php
+++ b/Http/Firewall/LogoutListener.php
@@ -75,8 +75,10 @@ class LogoutListener implements ListenerInterface
* validate the request.
*
* @param GetResponseEvent $event A GetResponseEvent instance
+ *
* @throws InvalidCsrfTokenException if the CSRF token is invalid
- * @throws RuntimeException if the LogoutSuccessHandlerInterface instance does not return a response
+ * @throws \RuntimeException if the LogoutSuccessHandlerInterface instance does not return a response
+ * @throws LogoutException
*/
public function handle(GetResponseEvent $event)
{
diff --git a/Http/Firewall/SwitchUserListener.php b/Http/Firewall/SwitchUserListener.php
index 7f0aa78..8e4f4e5 100644
--- a/Http/Firewall/SwitchUserListener.php
+++ b/Http/Firewall/SwitchUserListener.php
@@ -71,6 +71,8 @@ class SwitchUserListener implements ListenerInterface
* Handles digest authentication.
*
* @param GetResponseEvent $event A GetResponseEvent instance
+ *
+ * @throws \LogicException
*/
public function handle(GetResponseEvent $event)
{
@@ -102,6 +104,9 @@ class SwitchUserListener implements ListenerInterface
* @param Request $request A Request instance
*
* @return TokenInterface|null The new TokenInterface if successfully switched, null otherwise
+ *
+ * @throws \LogicException
+ * @throws AccessDeniedException
*/
private function attemptSwitchUser(Request $request)
{
@@ -148,6 +153,8 @@ class SwitchUserListener implements ListenerInterface
* @param Request $request A Request instance
*
* @return TokenInterface The original TokenInterface instance
+ *
+ * @throws AuthenticationCredentialsNotFoundException
*/
private function attemptExitUser(Request $request)
{
diff --git a/Http/HttpUtils.php b/Http/HttpUtils.php
index 6a2da08..a3c6f61 100644
--- a/Http/HttpUtils.php
+++ b/Http/HttpUtils.php
@@ -16,6 +16,7 @@ use Symfony\Component\Security\Core\SecurityContextInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Routing\Matcher\UrlMatcherInterface;
+use Symfony\Component\Routing\Matcher\RequestMatcherInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
@@ -33,12 +34,15 @@ class HttpUtils
/**
* Constructor.
*
- * @param UrlGeneratorInterface $urlGenerator A UrlGeneratorInterface instance
- * @param UrlMatcherInterface $urlMatcher A UrlMatcherInterface instance
+ * @param UrlGeneratorInterface $urlGenerator A UrlGeneratorInterface instance
+ * @param UrlMatcherInterface|RequestMatcherInterface $matcher The Url or Request matcher
*/
- public function __construct(UrlGeneratorInterface $urlGenerator = null, UrlMatcherInterface $urlMatcher = null)
+ public function __construct(UrlGeneratorInterface $urlGenerator = null, $urlMatcher = null)
{
$this->urlGenerator = $urlGenerator;
+ if ($urlMatcher !== null && !$urlMatcher instanceof UrlMatcherInterface && !$urlMatcher instanceof RequestMatcherInterface) {
+ throw new \InvalidArgumentException('Matcher must either implement UrlMatcherInterface or RequestMatcherInterface.');
+ }
$this->urlMatcher = $urlMatcher;
}
@@ -96,7 +100,12 @@ class HttpUtils
{
if ('/' !== $path[0]) {
try {
- $parameters = $this->urlMatcher->match($request->getPathInfo());
+ // matching a request is more powerful than matching a URL path + context, so try that first
+ if ($this->urlMatcher instanceof RequestMatcherInterface) {
+ $parameters = $this->urlMatcher->matchRequest($request);
+ } else {
+ $parameters = $this->urlMatcher->match($request->getPathInfo());
+ }
return $path === $parameters['_route'];
} catch (MethodNotAllowedException $e) {
diff --git a/Http/RememberMe/AbstractRememberMeServices.php b/Http/RememberMe/AbstractRememberMeServices.php
index 1d6a109..e49ce14 100644
--- a/Http/RememberMe/AbstractRememberMeServices.php
+++ b/Http/RememberMe/AbstractRememberMeServices.php
@@ -47,6 +47,8 @@ abstract class AbstractRememberMeServices implements RememberMeServicesInterface
* @param string $providerKey
* @param array $options
* @param LoggerInterface $logger
+ *
+ * @throws \InvalidArgumentException
*/
public function __construct(array $userProviders, $key, $providerKey, array $options = array(), LoggerInterface $logger = null)
{
@@ -89,7 +91,9 @@ abstract class AbstractRememberMeServices implements RememberMeServicesInterface
*
* @param Request $request
*
- * @return TokenInterface
+ * @return TokenInterface|null
+ *
+ * @throws CookieTheftException
*/
final public function autoLogin(Request $request)
{
diff --git a/LICENSE b/LICENSE
index cdffe7a..88a57f8 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2012 Fabien Potencier
+Copyright (c) 2004-2013 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/Tests/Acl/Dbal/AclProviderTest.php b/Tests/Acl/Dbal/AclProviderTest.php
index e03edc0..83771ee 100644
--- a/Tests/Acl/Dbal/AclProviderTest.php
+++ b/Tests/Acl/Dbal/AclProviderTest.php
@@ -27,7 +27,7 @@ class AclProviderTest extends \PHPUnit_Framework_TestCase
protected $insertSidStmt;
/**
- * @expectedException Symfony\Component\Security\Acl\Exception\AclNotFoundException
+ * @expectedException \Symfony\Component\Security\Acl\Exception\AclNotFoundException
* @expectedMessage There is no ACL for the given object identity.
*/
public function testFindAclThrowsExceptionWhenNoAclExists()
diff --git a/Tests/Acl/Dbal/MutableAclProviderTest.php b/Tests/Acl/Dbal/MutableAclProviderTest.php
index 837daad..3e8d65f 100644
--- a/Tests/Acl/Dbal/MutableAclProviderTest.php
+++ b/Tests/Acl/Dbal/MutableAclProviderTest.php
@@ -53,7 +53,7 @@ class MutableAclProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Acl\Exception\AclAlreadyExistsException
+ * @expectedException \Symfony\Component\Security\Acl\Exception\AclAlreadyExistsException
*/
public function testCreateAclThrowsExceptionWhenAclAlreadyExists()
{
diff --git a/Tests/Acl/Domain/PermissionGrantingStrategyTest.php b/Tests/Acl/Domain/PermissionGrantingStrategyTest.php
index f34bc3e..d200d2b 100644
--- a/Tests/Acl/Domain/PermissionGrantingStrategyTest.php
+++ b/Tests/Acl/Domain/PermissionGrantingStrategyTest.php
@@ -73,7 +73,7 @@ class PermissionGrantingStrategyTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Acl\Exception\NoAceFoundException
+ * @expectedException \Symfony\Component\Security\Acl\Exception\NoAceFoundException
*/
public function testIsGrantedReturnsExceptionIfNoAceIsFound()
{
diff --git a/Tests/Core/Authentication/Provider/AnonymousAuthenticationProviderTest.php b/Tests/Core/Authentication/Provider/AnonymousAuthenticationProviderTest.php
index 0a76724..d0da147 100644
--- a/Tests/Core/Authentication/Provider/AnonymousAuthenticationProviderTest.php
+++ b/Tests/Core/Authentication/Provider/AnonymousAuthenticationProviderTest.php
@@ -31,7 +31,7 @@ class AnonymousAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\BadCredentialsException
+ * @expectedException \Symfony\Component\Security\Core\Exception\BadCredentialsException
*/
public function testAuthenticateWhenKeyIsNotValid()
{
diff --git a/Tests/Core/Authentication/Provider/DaoAuthenticationProviderTest.php b/Tests/Core/Authentication/Provider/DaoAuthenticationProviderTest.php
index 4da0337..8b27061 100644
--- a/Tests/Core/Authentication/Provider/DaoAuthenticationProviderTest.php
+++ b/Tests/Core/Authentication/Provider/DaoAuthenticationProviderTest.php
@@ -18,7 +18,7 @@ use Symfony\Component\Security\Core\Authentication\Provider\DaoAuthenticationPro
class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
{
/**
- * @expectedException Symfony\Component\Security\Core\Exception\AuthenticationServiceException
+ * @expectedException \Symfony\Component\Security\Core\Exception\AuthenticationServiceException
*/
public function testRetrieveUserWhenProviderDoesNotReturnAnUserInterface()
{
@@ -30,7 +30,7 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\UsernameNotFoundException
+ * @expectedException \Symfony\Component\Security\Core\Exception\UsernameNotFoundException
*/
public function testRetrieveUserWhenUsernameIsNotFound()
{
@@ -48,7 +48,7 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\AuthenticationServiceException
+ * @expectedException \Symfony\Component\Security\Core\Exception\AuthenticationServiceException
*/
public function testRetrieveUserWhenAnExceptionOccurs()
{
@@ -105,7 +105,7 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\BadCredentialsException
+ * @expectedException \Symfony\Component\Security\Core\Exception\BadCredentialsException
*/
public function testCheckAuthenticationWhenCredentialsAreEmpty()
{
@@ -161,7 +161,7 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\BadCredentialsException
+ * @expectedException \Symfony\Component\Security\Core\Exception\BadCredentialsException
*/
public function testCheckAuthenticationWhenCredentialsAreNotValid()
{
@@ -185,7 +185,7 @@ class DaoAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\BadCredentialsException
+ * @expectedException \Symfony\Component\Security\Core\Exception\BadCredentialsException
*/
public function testCheckAuthenticationDoesNotReauthenticateWhenPasswordHasChanged()
{
diff --git a/Tests/Core/Authentication/Provider/PreAuthenticatedAuthenticationProviderTest.php b/Tests/Core/Authentication/Provider/PreAuthenticatedAuthenticationProviderTest.php
index 9476c0d..f7ffb1e 100644
--- a/Tests/Core/Authentication/Provider/PreAuthenticatedAuthenticationProviderTest.php
+++ b/Tests/Core/Authentication/Provider/PreAuthenticatedAuthenticationProviderTest.php
@@ -42,7 +42,7 @@ class PreAuthenticatedAuthenticationProviderTest extends \PHPUnit_Framework_Test
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\BadCredentialsException
+ * @expectedException \Symfony\Component\Security\Core\Exception\BadCredentialsException
*/
public function testAuthenticateWhenNoUserIsSet()
{
@@ -70,7 +70,7 @@ class PreAuthenticatedAuthenticationProviderTest extends \PHPUnit_Framework_Test
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\LockedException
+ * @expectedException \Symfony\Component\Security\Core\Exception\LockedException
*/
public function testAuthenticateWhenUserCheckerThrowsException()
{
diff --git a/Tests/Core/Authentication/Provider/RememberMeAuthenticationProviderTest.php b/Tests/Core/Authentication/Provider/RememberMeAuthenticationProviderTest.php
index fcc2514..5e250e0 100644
--- a/Tests/Core/Authentication/Provider/RememberMeAuthenticationProviderTest.php
+++ b/Tests/Core/Authentication/Provider/RememberMeAuthenticationProviderTest.php
@@ -34,7 +34,7 @@ class RememberMeAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\BadCredentialsException
+ * @expectedException \Symfony\Component\Security\Core\Exception\BadCredentialsException
*/
public function testAuthenticateWhenKeysDoNotMatch()
{
@@ -45,7 +45,7 @@ class RememberMeAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\AccountExpiredException
+ * @expectedException \Symfony\Component\Security\Core\Exception\AccountExpiredException
*/
public function testAuthenticateWhenPostChecksFails()
{
diff --git a/Tests/Core/Authentication/Provider/UserAuthenticationProviderTest.php b/Tests/Core/Authentication/Provider/UserAuthenticationProviderTest.php
index 1b68531..1516a5f 100644
--- a/Tests/Core/Authentication/Provider/UserAuthenticationProviderTest.php
+++ b/Tests/Core/Authentication/Provider/UserAuthenticationProviderTest.php
@@ -33,7 +33,7 @@ class UserAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\UsernameNotFoundException
+ * @expectedException \Symfony\Component\Security\Core\Exception\UsernameNotFoundException
*/
public function testAuthenticateWhenUsernameIsNotFound()
{
@@ -47,7 +47,7 @@ class UserAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\BadCredentialsException
+ * @expectedException \Symfony\Component\Security\Core\Exception\BadCredentialsException
*/
public function testAuthenticateWhenUsernameIsNotFoundAndHideIsTrue()
{
@@ -61,7 +61,7 @@ class UserAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\AuthenticationServiceException
+ * @expectedException \Symfony\Component\Security\Core\Exception\AuthenticationServiceException
*/
public function testAuthenticateWhenProviderDoesNotReturnAnUserInterface()
{
@@ -75,7 +75,7 @@ class UserAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\CredentialsExpiredException
+ * @expectedException \Symfony\Component\Security\Core\Exception\CredentialsExpiredException
*/
public function testAuthenticateWhenPreChecksFails()
{
@@ -95,7 +95,7 @@ class UserAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\AccountExpiredException
+ * @expectedException \Symfony\Component\Security\Core\Exception\AccountExpiredException
*/
public function testAuthenticateWhenPostChecksFails()
{
@@ -115,7 +115,7 @@ class UserAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\BadCredentialsException
+ * @expectedException \Symfony\Component\Security\Core\Exception\BadCredentialsException
* @expectedExceptionMessage Bad credentials
*/
public function testAuthenticateWhenPostCheckAuthenticationFails()
@@ -134,7 +134,7 @@ class UserAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\BadCredentialsException
+ * @expectedException \Symfony\Component\Security\Core\Exception\BadCredentialsException
* @expectedExceptionMessage Foo
*/
public function testAuthenticateWhenPostCheckAuthenticationFailsWithHideFalse()
diff --git a/Tests/Core/Authentication/RememberMe/InMemoryTokenProviderTest.php b/Tests/Core/Authentication/RememberMe/InMemoryTokenProviderTest.php
index 3944fb1..1739714 100644
--- a/Tests/Core/Authentication/RememberMe/InMemoryTokenProviderTest.php
+++ b/Tests/Core/Authentication/RememberMe/InMemoryTokenProviderTest.php
@@ -27,7 +27,7 @@ class InMemoryTokenProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\TokenNotFoundException
+ * @expectedException \Symfony\Component\Security\Core\Exception\TokenNotFoundException
*/
public function testLoadTokenBySeriesThrowsNotFoundException()
{
@@ -49,7 +49,7 @@ class InMemoryTokenProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\TokenNotFoundException
+ * @expectedException \Symfony\Component\Security\Core\Exception\TokenNotFoundException
*/
public function testDeleteToken()
{
diff --git a/Tests/Core/SecurityContextTest.php b/Tests/Core/SecurityContextTest.php
index 66a4b13..124ebf9 100644
--- a/Tests/Core/SecurityContextTest.php
+++ b/Tests/Core/SecurityContextTest.php
@@ -41,7 +41,7 @@ class SecurityContextTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException
+ * @expectedException \Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException
*/
public function testVoteWithoutAuthenticationToken()
{
diff --git a/Tests/Core/User/AccountCheckerTest.php b/Tests/Core/User/AccountCheckerTest.php
index 315e0d4..f28067f 100644
--- a/Tests/Core/User/AccountCheckerTest.php
+++ b/Tests/Core/User/AccountCheckerTest.php
@@ -33,7 +33,7 @@ class UserCheckerTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\CredentialsExpiredException
+ * @expectedException \Symfony\Component\Security\Core\Exception\CredentialsExpiredException
*/
public function testCheckPreAuthCredentialsExpired()
{
@@ -65,7 +65,7 @@ class UserCheckerTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\LockedException
+ * @expectedException \Symfony\Component\Security\Core\Exception\LockedException
*/
public function testCheckPostAuthAccountLocked()
{
@@ -78,7 +78,7 @@ class UserCheckerTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\DisabledException
+ * @expectedException \Symfony\Component\Security\Core\Exception\DisabledException
*/
public function testCheckPostAuthDisabled()
{
@@ -92,7 +92,7 @@ class UserCheckerTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\AccountExpiredException
+ * @expectedException \Symfony\Component\Security\Core\Exception\AccountExpiredException
*/
public function testCheckPostAuthAccountExpired()
{
diff --git a/Tests/Core/User/ChainUserProviderTest.php b/Tests/Core/User/ChainUserProviderTest.php
index 5edbbed..0fddcd6 100644
--- a/Tests/Core/User/ChainUserProviderTest.php
+++ b/Tests/Core/User/ChainUserProviderTest.php
@@ -42,7 +42,7 @@ class ChainUserProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\UsernameNotFoundException
+ * @expectedException \Symfony\Component\Security\Core\Exception\UsernameNotFoundException
*/
public function testLoadUserByUsernameThrowsUsernameNotFoundException()
{
@@ -107,7 +107,7 @@ class ChainUserProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\UnsupportedUserException
+ * @expectedException \Symfony\Component\Security\Core\Exception\UnsupportedUserException
*/
public function testRefreshUserThrowsUnsupportedUserException()
{
diff --git a/Tests/Core/User/InMemoryProviderTest.php b/Tests/Core/User/InMemoryProviderTest.php
index 9230be4..5197a29 100644
--- a/Tests/Core/User/InMemoryProviderTest.php
+++ b/Tests/Core/User/InMemoryProviderTest.php
@@ -52,7 +52,7 @@ class InMemoryUserProviderTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\UsernameNotFoundException
+ * @expectedException \Symfony\Component\Security\Core\Exception\UsernameNotFoundException
*/
public function testLoadUserByUsernameDoesNotExist()
{
diff --git a/Tests/Core/Util/ClassUtilsTest.php b/Tests/Core/Util/ClassUtilsTest.php
index edfd779..8359236 100644
--- a/Tests/Core/Util/ClassUtilsTest.php
+++ b/Tests/Core/Util/ClassUtilsTest.php
@@ -15,7 +15,7 @@ namespace Symfony\Component\Security\Tests\Core\Util
class ClassUtilsTest extends \PHPUnit_Framework_TestCase
{
- static public function dataGetClass()
+ public static function dataGetClass()
{
return array(
array('stdClass', 'stdClass'),
diff --git a/Tests/Http/Firewall/AccessListenerTest.php b/Tests/Http/Firewall/AccessListenerTest.php
index e3ffbfc..53ab350 100644
--- a/Tests/Http/Firewall/AccessListenerTest.php
+++ b/Tests/Http/Firewall/AccessListenerTest.php
@@ -31,7 +31,7 @@ class AccessListenerTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\AccessDeniedException
+ * @expectedException \Symfony\Component\Security\Core\Exception\AccessDeniedException
*/
public function testHandleWhenTheAccessDecisionManagerDecidesToRefuseAccess()
{
@@ -198,7 +198,7 @@ class AccessListenerTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException
+ * @expectedException \Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException
*/
public function testHandleWhenTheSecurityContextHasNoToken()
{
diff --git a/Tests/Http/Firewall/ContextListenerTest.php b/Tests/Http/Firewall/ContextListenerTest.php
index d360ef5..620aa29 100644
--- a/Tests/Http/Firewall/ContextListenerTest.php
+++ b/Tests/Http/Firewall/ContextListenerTest.php
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Test\Component\Security\Http\Firewall;
+namespace Symfony\Component\Security\Tests\Http\Firewall;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
diff --git a/Tests/Http/Firewall/LogoutListenerTest.php b/Tests/Http/Firewall/LogoutListenerTest.php
index aa0f5a7..ba94b6e 100644
--- a/Tests/Http/Firewall/LogoutListenerTest.php
+++ b/Tests/Http/Firewall/LogoutListenerTest.php
@@ -166,7 +166,7 @@ class LogoutListenerTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Security\Core\Exception\LogoutException
+ * @expectedException \Symfony\Component\Security\Core\Exception\LogoutException
*/
public function testCsrfValidationFails()
{