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();