mirror of
https://github.com/Mibew/mibew.git
synced 2025-03-03 18:38:31 +03:00
Implement "AuthenticationManagerAwareInterface" in "ControllerResolver" class
This commit is contained in:
parent
184e6ccdc3
commit
8dbc46145c
@ -23,7 +23,7 @@ use Mibew\Routing\RouterAwareInterface;
|
|||||||
use Symfony\Component\Routing\RouterInterface;
|
use Symfony\Component\Routing\RouterInterface;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
class ControllerResolver implements RouterAwareInterface
|
class ControllerResolver implements RouterAwareInterface, AuthenticationManagerAwareInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var RouterInterface|null
|
* @var RouterInterface|null
|
||||||
@ -64,6 +64,22 @@ class ControllerResolver implements RouterAwareInterface
|
|||||||
$this->router = $router;
|
$this->router = $router;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getAuthenticationManager()
|
||||||
|
{
|
||||||
|
return $this->authenticationManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function setAuthenticationManager(AuthenticationManagerInterface $manager)
|
||||||
|
{
|
||||||
|
$this->authenticationManager = $manager;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resolves controller by request.
|
* Resolves controller by request.
|
||||||
*
|
*
|
||||||
@ -122,7 +138,7 @@ class ControllerResolver implements RouterAwareInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($object instanceof AuthenticationManagerAwareInterface) {
|
if ($object instanceof AuthenticationManagerAwareInterface) {
|
||||||
$object->setAuthenticationManager($this->authenticationManager);
|
$object->setAuthenticationManager($this->getAuthenticationManager());
|
||||||
}
|
}
|
||||||
|
|
||||||
return array($object, $method);
|
return array($object, $method);
|
||||||
|
Loading…
Reference in New Issue
Block a user