Skip to content

Commit 91e8a5b

Browse files
committed
Merge branch '4.4' into 5.2
* 4.4: Simplify some code with null coalesce operator
2 parents d80f9fd + b0eb9ba commit 91e8a5b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Firewall/RememberMeListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function __construct(TokenStorageInterface $tokenStorage, RememberMeServi
4949
$this->logger = $logger;
5050
$this->dispatcher = $dispatcher;
5151
$this->catchExceptions = $catchExceptions;
52-
$this->sessionStrategy = null === $sessionStrategy ? new SessionAuthenticationStrategy(SessionAuthenticationStrategy::MIGRATE) : $sessionStrategy;
52+
$this->sessionStrategy = $sessionStrategy ?? new SessionAuthenticationStrategy(SessionAuthenticationStrategy::MIGRATE);
5353
}
5454

5555
/**

Tests/Firewall/ExceptionListenerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function testAccessDeniedExceptionFullFledgedAndWithoutAccessDeniedHandle
9999
$listener->onKernelException($event);
100100

101101
$this->assertNull($event->getResponse());
102-
$this->assertSame(null === $eventException ? $exception : $eventException, $event->getThrowable()->getPrevious());
102+
$this->assertSame($eventException ?? $exception, $event->getThrowable()->getPrevious());
103103
}
104104

105105
/**
@@ -122,7 +122,7 @@ public function testAccessDeniedExceptionFullFledgedAndWithoutAccessDeniedHandle
122122

123123
$this->assertEquals('Unauthorized', $event->getResponse()->getContent());
124124
$this->assertEquals(401, $event->getResponse()->getStatusCode());
125-
$this->assertSame(null === $eventException ? $exception : $eventException, $event->getThrowable()->getPrevious());
125+
$this->assertSame($eventException ?? $exception, $event->getThrowable()->getPrevious());
126126
}
127127

128128
/**
@@ -139,7 +139,7 @@ public function testAccessDeniedExceptionFullFledgedAndWithAccessDeniedHandlerAn
139139
$listener->onKernelException($event);
140140

141141
$this->assertEquals('error', $event->getResponse()->getContent());
142-
$this->assertSame(null === $eventException ? $exception : $eventException, $event->getThrowable()->getPrevious());
142+
$this->assertSame($eventException ?? $exception, $event->getThrowable()->getPrevious());
143143
}
144144

145145
/**
@@ -156,7 +156,7 @@ public function testAccessDeniedExceptionNotFullFledged(\Exception $exception, \
156156
$listener->onKernelException($event);
157157

158158
$this->assertEquals('OK', $event->getResponse()->getContent());
159-
$this->assertSame(null === $eventException ? $exception : $eventException, $event->getThrowable()->getPrevious());
159+
$this->assertSame($eventException ?? $exception, $event->getThrowable()->getPrevious());
160160
}
161161

162162
public function testLogoutException()

0 commit comments

Comments
 (0)