Commit 5ca0247c authored by David Surville's avatar David Surville
Browse files

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

parent 431bbc99
Pipeline #4767 passed with stage
in 25 seconds
......@@ -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' => [
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment