8000 [HttpKernel] made RouterListener implement EventSubscriberInterface · echavez/symfony@7a89d34 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7a89d34

Browse files
committed
[HttpKernel] made RouterListener implement EventSubscriberInterface
1 parent 4539e5c commit 7a89d34

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Symfony/Component/HttpKernel/EventListener/RouterListener.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,20 @@
1414
use Symfony\Component\HttpKernel\Log\LoggerInterface;
1515
use Symfony\Component\HttpKernel\HttpKernelInterface;
1616
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
17+
use Symfony\Component\HttpKernel\KernelEvents;
1718
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
1819
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
1920
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
2021
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
2122
use Symfony\Component\Routing\Matcher\UrlMatcherInterface;
23+
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
2224

2325
/**
2426
* Initializes request attributes based on a matching route.
2527
*
2628
* @author Fabien Potencier <fabien@symfony.com>
2729
*/
28-
class RouterListener
30+
class RouterListener implements EventSubscriberInterface
2931
{
3032
private $urlMatcher;
3133
private $logger;
@@ -85,4 +87,11 @@ private function parametersToString(array $parameters)
8587

8688
return implode(', ', $pieces);
8789
}
90+
91+
static public function getSubscribedEvents()
92+
{
93+
return array(
94+
KernelEvents::REQUEST => array(array('onEarlyKernelRequest', 255), array('onKernelRequest', 10)),
95+
);
96+
}
8897
}

0 commit comments

Comments
 (0)
0