Implement "AuthenticationManagerAwareInterface" in "ControllerResolver" class

This commit is contained in:
Dmitriy Simushev 2014-07-04 12:38:14 +00:00
parent 184e6ccdc3
commit 8dbc46145c

View File

@ -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);