From 5d5a58015a8d2b9339d3c8254cbac1c43f28a3f7 Mon Sep 17 00:00:00 2001 From: Vidar Date: Wed, 6 Sep 2023 14:32:08 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Andrew Longosz --- .../EventListener/SessionInitByPostListener.php | 2 +- .../Tests/EventListener/SessionInitByPostListenerTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eZ/Bundle/EzPublishCoreBundle/EventListener/SessionInitByPostListener.php b/eZ/Bundle/EzPublishCoreBundle/EventListener/SessionInitByPostListener.php index ba9d13101a..5048b939de 100644 --- a/eZ/Bundle/EzPublishCoreBundle/EventListener/SessionInitByPostListener.php +++ b/eZ/Bundle/EzPublishCoreBundle/EventListener/SessionInitByPostListener.php @@ -32,7 +32,7 @@ public function onSiteAccessMatch(PostSiteAccessMatchEvent $event) $session = $request->getSession(); } - if (!$session || $event->getRequestType() !== HttpKernelInterface::MAIN_REQUEST) { + if (null === $session || $event->getRequestType() !== HttpKernelInterface::MAIN_REQUEST) { return; } diff --git a/eZ/Bundle/EzPublishCoreBundle/Tests/EventListener/SessionInitByPostListenerTest.php b/eZ/Bundle/EzPublishCoreBundle/Tests/EventListener/SessionInitByPostListenerTest.php index 5bb203732c..76e3cbc50c 100644 --- a/eZ/Bundle/EzPublishCoreBundle/Tests/EventListener/SessionInitByPostListenerTest.php +++ b/eZ/Bundle/EzPublishCoreBundle/Tests/EventListener/SessionInitByPostListenerTest.php @@ -118,7 +118,7 @@ public function testOnSiteAccessMatchNewSessionName() $this->listener->onSiteAccessMatch($event); } - public function testOnSiteAccessMatchNoSession() + public function testOnSiteAccessMatchNoSession(): void { $request = new Request();