Skip to content

Commit a90021f

Browse files
committed
Improve the checking if the current request is a master request in the ControllerListener
1 parent 6297ae3 commit a90021f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/AppBundle/EventListener/ControllerListener.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace AppBundle\EventListener;
1313

14-
use Symfony\Component\HttpKernel\HttpKernelInterface;
1514
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
1615
use AppBundle\Twig\SourceCodeExtension;
1716

@@ -41,7 +40,7 @@ public function registerCurrentController(FilterControllerEvent $event)
4140
// this check is needed because in Symfony a request can perform any
4241
// number of sub-requests. See
4342
// http://symfony.com/doc/current/components/http_kernel/introduction.html#sub-requests
44-
if (HttpKernelInterface::MASTER_REQUEST === $event->getRequestType()) {
43+
if ($event->isMasterRequest()) {
4544
$this->twigExtension->setController($event->getController());
4645
}
4746
}

0 commit comments

Comments
 (0)