Skip to content

Commit

Permalink
Replace deprecated KernelEvent::isMasterRequest() (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
stchr authored May 6, 2022
1 parent 5795a43 commit 17a880b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Listener/ResponseListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,17 @@ public static function getSubscribedEvents(): array

public function onKernelResponse(KernelResponseEvent $event): void
{
if (! $event->isMasterRequest()) {
if (! $this->isMainRequest($event)) {
return;
}

$this->interactor->addContextFromConfig();
}

private function isMainRequest(KernelResponseEvent $event): bool
{
return method_exists($event, 'isMainRequest') ? $event->isMainRequest() : $event->isMasterRequest();
}
}

if (! \class_exists(KernelResponseEvent::class)) {
Expand Down

0 comments on commit 17a880b

Please sign in to comment.