Use "RouterInterface" instead of "Router" in "RouterAwareInterface"

This commit is contained in:
Dmitriy Simushev 2014-07-04 12:04:51 +00:00
parent eb078a0b73
commit 2ab669ba3a
2 changed files with 10 additions and 8 deletions

View File

@ -26,13 +26,13 @@ use Mibew\Http\Exception\AccessDeniedException as AccessDeniedHttpException;
use Mibew\Http\Exception\HttpException; use Mibew\Http\Exception\HttpException;
use Mibew\Http\Exception\MethodNotAllowedException as MethodNotAllowedHttpException; use Mibew\Http\Exception\MethodNotAllowedException as MethodNotAllowedHttpException;
use Mibew\Http\Exception\NotFoundException as NotFoundHttpException; use Mibew\Http\Exception\NotFoundException as NotFoundHttpException;
use Mibew\Routing\Router;
use Mibew\Routing\RouterAwareInterface; use Mibew\Routing\RouterAwareInterface;
use Mibew\Routing\Exception\AccessDeniedException as AccessDeniedRoutingException; use Mibew\Routing\Exception\AccessDeniedException as AccessDeniedRoutingException;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Routing\RequestContext; use Symfony\Component\Routing\RequestContext;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Routing\Exception\MethodNotAllowedException as MethodNotAllowedRoutingException; use Symfony\Component\Routing\Exception\MethodNotAllowedException as MethodNotAllowedRoutingException;
use Symfony\Component\Routing\Exception\ResourceNotFoundException as ResourceNotFoundRoutingException; use Symfony\Component\Routing\Exception\ResourceNotFoundException as ResourceNotFoundRoutingException;
@ -42,7 +42,7 @@ use Symfony\Component\Routing\Exception\ResourceNotFoundException as ResourceNot
class Application implements RouterAwareInterface class Application implements RouterAwareInterface
{ {
/** /**
* @var Router|null * @var RouterInterface|null
*/ */
protected $router = null; protected $router = null;
@ -64,9 +64,9 @@ class Application implements RouterAwareInterface
/** /**
* Class constructor. * Class constructor.
* *
* @param Router $router Appropriate router instance. * @param RouterInterface $router Appropriate router instance.
*/ */
public function __construct(Router $router) public function __construct(RouterInterface $router)
{ {
$this->router = $router; $this->router = $router;
$this->authenticationManager = new AuthenticationManager(); $this->authenticationManager = new AuthenticationManager();
@ -150,7 +150,7 @@ class Application implements RouterAwareInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function setRouter(Router $router) public function setRouter(RouterInterface $router)
{ {
$this->router = $router; $this->router = $router;
} }

View File

@ -17,6 +17,8 @@
namespace Mibew\Routing; namespace Mibew\Routing;
use Symfony\Component\Routing\RouterInterface;
/** /**
* An interface for all router aware objects. * An interface for all router aware objects.
*/ */
@ -25,14 +27,14 @@ interface RouterAwareInterface
/** /**
* Sets associated router object. * Sets associated router object.
* *
* @param Router $router A router instance. * @param RouterInterface $router A router instance.
*/ */
public function setRouter(Router $router); public function setRouter(RouterInterface $router);
/** /**
* Gets associated router object. * Gets associated router object.
* *
* @return Router A router instance; * @return RouterInterface A router instance;
*/ */
public function getRouter(); public function getRouter();
} }