Skip to content

Commit

Permalink
Merge pull request #13
Browse files Browse the repository at this point in the history
  • Loading branch information
jmikola committed Aug 14, 2015
2 parents c6a479f + d1a3253 commit 212cce9
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions src/Jmikola/AutoLogin/Http/Firewall/AutoLoginListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
use Symfony\Component\Security\Core\SecurityContextInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Http\SecurityEvents;
Expand All @@ -29,16 +30,25 @@ class AutoLoginListener implements ListenerInterface
/**
* Constructor.
*
* @param SecurityContextInterface $securityContext
* @param AuthenticationManagerInterface $authenticationManager
* @param string $providerKey
* @param string $tokenParam
* @param LoggerInterface $logger
* @param EventDispatcherInterface $dispatcher
* @param array $options
* @param TokenStorageInterface|SecurityContextInterface $securityContext
* @param AuthenticationManagerInterface $authenticationManager
* @param string $providerKey
* @param string $tokenParam
* @param LoggerInterface $logger
* @param EventDispatcherInterface $dispatcher
* @param array $options
*/
public function __construct(SecurityContextInterface $securityContext, AuthenticationManagerInterface $authenticationManager, $providerKey, $tokenParam, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null, array $options = array())
public function __construct($securityContext, AuthenticationManagerInterface $authenticationManager, $providerKey, $tokenParam, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null, array $options = array())
{
if (!($securityContext instanceof SecurityContextInterface) &&
!($securityContext instanceof TokenStorageInterface)) {
throw new \InvalidArgumentException(sprintf(
'Argument 1 passed to %s() must be an instance of Symfony\Component\Security\Core\SecurityContextInterface or Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface, %s given',
__METHOD__,
is_object($securityContext) ? get_class($securityContext) : gettype($securityContext)
));
}

$this->securityContext = $securityContext;
$this->authenticationManager = $authenticationManager;
$this->providerKey = $providerKey;
Expand Down

0 comments on commit 212cce9

Please sign in to comment.