diff --git a/Firewall/RememberMeListener.php b/Firewall/RememberMeListener.php index 441f70cc..d2df4a2b 100644 --- a/Firewall/RememberMeListener.php +++ b/Firewall/RememberMeListener.php @@ -58,7 +58,7 @@ public function __construct(TokenStorageInterface $tokenStorage, RememberMeServi } $this->catchExceptions = $catchExceptions; - $this->sessionStrategy = null === $sessionStrategy ? new SessionAuthenticationStrategy(SessionAuthenticationStrategy::MIGRATE) : $sessionStrategy; + $this->sessionStrategy = $sessionStrategy ?? new SessionAuthenticationStrategy(SessionAuthenticationStrategy::MIGRATE); } /** diff --git a/Tests/Firewall/ExceptionListenerTest.php b/Tests/Firewall/ExceptionListenerTest.php index 46c48b66..27ad9897 100644 --- a/Tests/Firewall/ExceptionListenerTest.php +++ b/Tests/Firewall/ExceptionListenerTest.php @@ -99,7 +99,7 @@ public function testAccessDeniedExceptionFullFledgedAndWithoutAccessDeniedHandle $listener->onKernelException($event); $this->assertNull($event->getResponse()); - $this->assertSame(null === $eventException ? $exception : $eventException, $event->getThrowable()->getPrevious()); + $this->assertSame($eventException ?? $exception, $event->getThrowable()->getPrevious()); } /** @@ -122,7 +122,7 @@ public function testAccessDeniedExceptionFullFledgedAndWithoutAccessDeniedHandle $this->assertEquals('Unauthorized', $event->getResponse()->getContent()); $this->assertEquals(401, $event->getResponse()->getStatusCode()); - $this->assertSame(null === $eventException ? $exception : $eventException, $event->getThrowable()->getPrevious()); + $this->assertSame($eventException ?? $exception, $event->getThrowable()->getPrevious()); } /** @@ -139,7 +139,7 @@ public function testAccessDeniedExceptionFullFledgedAndWithAccessDeniedHandlerAn $listener->onKernelException($event); $this->assertEquals('error', $event->getResponse()->getContent()); - $this->assertSame(null === $eventException ? $exception : $eventException, $event->getThrowable()->getPrevious()); + $this->assertSame($eventException ?? $exception, $event->getThrowable()->getPrevious()); } /** @@ -156,7 +156,7 @@ public function testAccessDeniedExceptionNotFullFledged(\Exception $exception, \ $listener->onKernelException($event); $this->assertEquals('OK', $event->getResponse()->getContent()); - $this->assertSame(null === $eventException ? $exception : $eventException, $event->getThrowable()->getPrevious()); + $this->assertSame($eventException ?? $exception, $event->getThrowable()->getPrevious()); } public function testLogoutException()