Skip to content

Commit

Permalink
Merge branch '4.4' into 5.2
Browse files Browse the repository at this point in the history
* 4.4:
  [CS] Replace easy occurences of ?: with ??
  • Loading branch information
derrabus committed Apr 7, 2021
2 parents eb7cf73 + 2b2e821 commit 267840a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Firewall/ContextListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function __construct(TokenStorageInterface $tokenStorage, iterable $userP
$this->logger = $logger;
$this->dispatcher = class_exists(Event::class) ? LegacyEventDispatcherProxy::decorate($dispatcher) : $dispatcher;

$this->trustResolver = $trustResolver ?: new AuthenticationTrustResolver(AnonymousToken::class, RememberMeToken::class);
$this->trustResolver = $trustResolver ?? new AuthenticationTrustResolver(AnonymousToken::class, RememberMeToken::class);
$this->sessionTrackerEnabler = $sessionTrackerEnabler;
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/Firewall/ContextListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ protected function runSessionOnKernelResponse($newToken, $original = null)

private function handleEventWithPreviousSession($userProviders, UserInterface $user = null, RememberMeServicesInterface $rememberMeServices = null)
{
$tokenUser = $user ?: new User('foo', 'bar');
$tokenUser = $user ?? new User('foo', 'bar');
$session = new Session(new MockArraySessionStorage());
$session->set('_security_context_key', serialize(new UsernamePasswordToken($tokenUser, '', 'context_key', ['ROLE_USER'])));

Expand Down
8 changes: 4 additions & 4 deletions Tests/Firewall/ExceptionListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public function getAccessDeniedExceptionProvider()
private function createEntryPoint(Response $response = null)
{
$entryPoint = $this->createMock(AuthenticationEntryPointInterface::class);
$entryPoint->expects($this->once())->method('start')->willReturn($response ?: new Response('OK'));
$entryPoint->expects($this->once())->method('start')->willReturn($response ?? new Response('OK'));

return $entryPoint;
}
Expand All @@ -209,9 +209,9 @@ private function createEvent(\Exception $exception, $kernel = null)
private function createExceptionListener(TokenStorageInterface $tokenStorage = null, AuthenticationTrustResolverInterface $trustResolver = null, HttpUtils $httpUtils = null, AuthenticationEntryPointInterface $authenticationEntryPoint = null, $errorPage = null, AccessDeniedHandlerInterface $accessDeniedHandler = null)
{
return new ExceptionListener(
$tokenStorage ?: $this->createMock(TokenStorageInterface::class),
$trustResolver ?: $this->createMock(AuthenticationTrustResolverInterface::class),
$httpUtils ?: $this->createMock(HttpUtils::class),
$tokenStorage ?? $this->createMock(TokenStorageInterface::class),
$trustResolver ?? $this->createMock(AuthenticationTrustResolverInterface::class),
$httpUtils ?? $this->createMock(HttpUtils::class),
'key',
$authenticationEntryPoint,
$errorPage,
Expand Down

0 comments on commit 267840a

Please sign in to comment.