Commit 21d6ff45 authored by Fabien Potencier's avatar Fabien Potencier

simplified some calls

parent 7a3dc7f2
...@@ -292,7 +292,7 @@ class Application extends Container implements HttpKernelInterface, TerminableIn ...@@ -292,7 +292,7 @@ class Application extends Container implements HttpKernelInterface, TerminableIn
$app = $this; $app = $this;
$this->on(KernelEvents::REQUEST, function (GetResponseEvent $event) use ($callback, $app) { $this->on(KernelEvents::REQUEST, function (GetResponseEvent $event) use ($callback, $app) {
if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { if (!$event->isMasterRequest()) {
return; return;
} }
...@@ -318,7 +318,7 @@ class Application extends Container implements HttpKernelInterface, TerminableIn ...@@ -318,7 +318,7 @@ class Application extends Container implements HttpKernelInterface, TerminableIn
$app = $this; $app = $this;
$this->on(KernelEvents::RESPONSE, function (FilterResponseEvent $event) use ($callback, $app) { $this->on(KernelEvents::RESPONSE, function (FilterResponseEvent $event) use ($callback, $app) {
if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { if (!$event->isMasterRequest()) {
return; return;
} }
......
...@@ -14,7 +14,6 @@ namespace Silex\EventListener; ...@@ -14,7 +14,6 @@ namespace Silex\EventListener;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use Psr\Log\LogLevel; use Psr\Log\LogLevel;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
...@@ -55,7 +54,7 @@ class LogListener implements EventSubscriberInterface ...@@ -55,7 +54,7 @@ class LogListener implements EventSubscriberInterface
*/ */
public function onKernelRequest(GetResponseEvent $event) public function onKernelRequest(GetResponseEvent $event)
{ {
if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { if (!$event->isMasterRequest()) {
return; return;
} }
...@@ -69,7 +68,7 @@ class LogListener implements EventSubscriberInterface ...@@ -69,7 +68,7 @@ class LogListener implements EventSubscriberInterface
*/ */
public function onKernelResponse(FilterResponseEvent $event) public function onKernelResponse(FilterResponseEvent $event)
{ {
if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { if (!$event->isMasterRequest()) {
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment