Skip to content

Commit

Permalink
Fix deprecated calls to masterRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
Roshyo committed Oct 27, 2021
1 parent ed594f4 commit 5e96f62
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Bundle/Storage/CookieStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ public static function getSubscribedEvents(): array

public function onKernelRequest(RequestEvent $event): void
{
if (!$event->isMasterRequest()) {
if (\method_exists($event, 'isMainRequest')) {
$isMainRequest = $event->isMainRequest();
} else {
$isMainRequest = $event->isMasterRequest();
}
if (!$isMainRequest) {
return;
}

Expand All @@ -53,7 +58,12 @@ public function onKernelRequest(RequestEvent $event): void

public function onKernelResponse(ResponseEvent $event): void
{
if (!$event->isMasterRequest()) {
if (\method_exists($event, 'isMainRequest')) {
$isMainRequest = $event->isMainRequest();
} else {
$isMainRequest = $event->isMasterRequest();
}
if (!$isMainRequest) {
return;
}

Expand Down

0 comments on commit 5e96f62

Please sign in to comment.