Changed the typehint in the LocaleListener
The listener does not depend on the RouterInterface but only on the RequestContextAwareInterface which is also implemented by the matcher and the generator. Changing the typehint allow reusing the listener in Silex.
This commit is contained in:
parent
3ab9a6eec5
commit
92e028f1f0
@ -13,7 +13,7 @@ namespace Symfony\Component\HttpKernel\EventListener;
|
|||||||
|
|
||||||
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
|
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
|
||||||
use Symfony\Component\HttpKernel\KernelEvents;
|
use Symfony\Component\HttpKernel\KernelEvents;
|
||||||
use Symfony\Component\Routing\RouterInterface;
|
use Symfony\Component\Routing\RequestContextAwareInterface;
|
||||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -26,7 +26,7 @@ class LocaleListener implements EventSubscriberInterface
|
|||||||
private $router;
|
private $router;
|
||||||
private $defaultLocale;
|
private $defaultLocale;
|
||||||
|
|
||||||
public function __construct($defaultLocale = 'en', RouterInterface $router = null)
|
public function __construct($defaultLocale = 'en', RequestContextAwareInterface $router = null)
|
||||||
{
|
{
|
||||||
$this->defaultLocale = $defaultLocale;
|
$this->defaultLocale = $defaultLocale;
|
||||||
$this->router = $router;
|
$this->router = $router;
|
||||||
|
Reference in New Issue
Block a user