Skip to content
Snippets Groups Projects
Commit 5ca0247c authored by David Surville's avatar David Surville
Browse files

Adapter Cas : possibilité d'injecter tout type de router

parent 431bbc99
No related branches found
No related tags found
No related merge requests found
Pipeline #4767 passed
......@@ -14,7 +14,8 @@ use Zend\EventManager\EventInterface;
use Zend\EventManager\EventManager;
use Zend\EventManager\EventManagerAwareInterface;
use Zend\EventManager\EventManagerInterface;
use Zend\Router\Http\TreeRouteStack;
use Zend\Router\RouteInterface;
use Zend\Router\RouteStackInterface;
use ZfcUser\Authentication\Adapter\AbstractAdapter;
use ZfcUser\Authentication\Adapter\ChainableAdapter;
......@@ -64,14 +65,14 @@ class Cas extends AbstractAdapter implements EventManagerAwareInterface
}
/**
* @var TreeRouteStack
* @var RouteInterface
*/
private $router;
/**
* @param TreeRouteStack $router
* @param RouteInterface $router
*/
public function setRouter(TreeRouteStack $router)
public function setRouter(RouteInterface $router)
{
$this->router = $router;
}
......@@ -264,10 +265,14 @@ class Cas extends AbstractAdapter implements EventManagerAwareInterface
}
/**
* @param TreeRouteStack $router
* @param RouteInterface $router
*/
public function reconfigureRoutesForCasAuth(TreeRouteStack $router)
public function reconfigureRoutesForCasAuth(RouteInterface $router)
{
if(!$router instanceof RouteStackInterface) {
return;
}
$router->addRoutes([
// remplace les routes existantes (cf. config du module)
'zfcuser' => [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment