Skip to content

Commit 41f0774

Browse files
committed
Merge pull request #21 from krizon/router-interface-handlers
Require RouterInterface instead of Router to support other routers in the authentication handlers
2 parents a0bb6c5 + 91058b6 commit 41f0774

3 files changed

Lines changed: 16 additions & 16 deletions

File tree

Component/Authentication/Handler/LoginFailureHandler.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313

1414
namespace CCDNUser\SecurityBundle\Component\Authentication\Handler;
1515

16+
use Symfony\Component\Routing\RouterInterface;
1617
use Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface;
1718
use Symfony\Component\Security\Core\Exception\AuthenticationException;
1819
use Symfony\Component\Security\Core\SecurityContext;
1920
use Symfony\Component\HttpFoundation\RedirectResponse;
2021
use Symfony\Component\HttpFoundation\Request;
2122
use Symfony\Component\HttpFoundation\Response;
22-
use Symfony\Bundle\FrameworkBundle\Routing\Router;
2323

2424
use CCDNUser\SecurityBundle\Component\Authentication\Tracker\LoginFailureTracker;
2525

@@ -39,7 +39,7 @@ class LoginFailureHandler implements AuthenticationFailureHandlerInterface
3939
/**
4040
*
4141
* @access protected
42-
* @var \Symfony\Bundle\FrameworkBundle\Routing\Router $router
42+
* @var \Symfony\Component\Routing\RouterInterface $router
4343
*/
4444
protected $router;
4545

@@ -60,11 +60,11 @@ class LoginFailureHandler implements AuthenticationFailureHandlerInterface
6060
/**
6161
*
6262
* @access public
63-
* @param \Symfony\Bundle\FrameworkBundle\Routing\Router $router
63+
* @param \Symfony\Component\Routing\RouterInterface $router
6464
* @param \CCDNUser\SecurityBundle\Component\Authentication\Tracker\LoginFailureTracker $loginFailureTracker
6565
* @param array $routeLogin
6666
*/
67-
public function __construct(Router $router, LoginFailureTracker $loginFailureTracker, $routeLogin)
67+
public function __construct(RouterInterface $router, LoginFailureTracker $loginFailureTracker, $routeLogin)
6868
{
6969
$this->router = $router;
7070
$this->loginFailureTracker = $loginFailureTracker;

Component/Authentication/Handler/LoginSuccessHandler.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313

1414
namespace CCDNUser\SecurityBundle\Component\Authentication\Handler;
1515

16+
use Symfony\Component\Routing\RouterInterface;
1617
use Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface;
1718
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
1819
use Symfony\Component\HttpFoundation\RedirectResponse;
1920
use Symfony\Component\HttpFoundation\Request;
2021
use Symfony\Component\HttpFoundation\Response;
21-
use Symfony\Bundle\FrameworkBundle\Routing\Router;
2222

2323
/**
2424
*
@@ -36,7 +36,7 @@ class LoginSuccessHandler implements AuthenticationSuccessHandlerInterface
3636
/**
3737
*
3838
* @access protected
39-
* @var \Symfony\Bundle\FrameworkBundle\Routing\Router $router
39+
* @var \Symfony\Component\Routing\RouterInterface $router
4040
*/
4141
protected $router;
4242

@@ -55,11 +55,11 @@ class LoginSuccessHandler implements AuthenticationSuccessHandlerInterface
5555
/**
5656
*
5757
* @access public
58-
* @param \Symfony\Bundle\FrameworkBundle\Routing\Router $router
59-
* @param array $routeReferer
60-
* @param array $routeLogin
58+
* @param \Symfony\Component\Routing\RouterInterface $router
59+
* @param array $routeReferer
60+
* @param array $routeLogin
6161
*/
62-
public function __construct(Router $router, $routeReferer, $routeLogin)
62+
public function __construct(RouterInterface $router, $routeReferer, $routeLogin)
6363
{
6464
$this->router = $router;
6565
$this->routeReferer = $routeReferer;

Component/Authentication/Handler/LogoutSuccessHandler.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313

1414
namespace CCDNUser\SecurityBundle\Component\Authentication\Handler;
1515

16+
use Symfony\Component\Routing\RouterInterface;
1617
use Symfony\Component\Security\Http\Logout\LogoutSuccessHandlerInterface;
1718
use Symfony\Component\HttpFoundation\RedirectResponse;
1819
use Symfony\Component\HttpFoundation\Request;
1920
use Symfony\Component\HttpFoundation\Response;
20-
use Symfony\Bundle\FrameworkBundle\Routing\Router;
2121

2222
/**
2323
*
@@ -35,7 +35,7 @@ class LogoutSuccessHandler implements LogoutSuccessHandlerInterface
3535
/**
3636
*
3737
* @access protected
38-
* @var \Symfony\Bundle\FrameworkBundle\Routing\Router $router
38+
* @var \Symfony\Component\Routing\RouterInterface $router
3939
*/
4040
protected $router;
4141

@@ -54,11 +54,11 @@ class LogoutSuccessHandler implements LogoutSuccessHandlerInterface
5454
/**
5555
*
5656
* @access public
57-
* @param \Symfony\Bundle\FrameworkBundle\Routing\Router $router
58-
* @param array $routeReferer
59-
* @param array $routeLogin
57+
* @param \Symfony\Component\Routing\RouterInterface $router
58+
* @param array $routeReferer
59+
* @param array $routeLogin
6060
*/
61-
public function __construct(Router $router, $routeReferer, $routeLogin)
61+
public function __construct(RouterInterface $router, $routeReferer, $routeLogin)
6262
{
6363
$this->router = $router;
6464
$this->routeReferer = $routeReferer;

0 commit comments

Comments
 (0)