Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.

Commit 9de8ba2

Browse files
committed
[CS] Replace easy occurences of ?: with ??
1 parent 5a96313 commit 9de8ba2

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

Core/Authentication/Provider/SimpleAuthenticationProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct(SimpleAuthenticatorInterface $simpleAuthenticator, U
3838
$this->simpleAuthenticator = $simpleAuthenticator;
3939
$this->userProvider = $userProvider;
4040
$this->providerKey = $providerKey;
41-
$this->userChecker = $userChecker ?: new UserChecker();
41+
$this->userChecker = $userChecker ?? new UserChecker();
4242
}
4343

4444
public function authenticate(TokenInterface $token)

Csrf/CsrfTokenManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ class CsrfTokenManager implements CsrfTokenManagerInterface
3939
*/
4040
public function __construct(TokenGeneratorInterface $generator = null, TokenStorageInterface $storage = null, $namespace = null)
4141
{
42-
$this->generator = $generator ?: new UriSafeTokenGenerator();
43-
$this->storage = $storage ?: new NativeSessionTokenStorage();
42+
$this->generator = $generator ?? new UriSafeTokenGenerator();
43+
$this->storage = $storage ?? new NativeSessionTokenStorage();
4444

4545
$superGlobalNamespaceGenerator = function () {
4646
return !empty($_SERVER['HTTPS']) && 'off' !== strtolower($_SERVER['HTTPS']) ? 'https-' : '';

Http/Firewall/ContextListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function __construct(TokenStorageInterface $tokenStorage, iterable $userP
7676
$this->dispatcher = $dispatcher;
7777
}
7878

79-
$this->trustResolver = $trustResolver ?: new AuthenticationTrustResolver(AnonymousToken::class, RememberMeToken::class);
79+
$this->trustResolver = $trustResolver ?? new AuthenticationTrustResolver(AnonymousToken::class, RememberMeToken::class);
8080
$this->sessionTrackerEnabler = $sessionTrackerEnabler;
8181
}
8282

Http/Firewall/SimplePreAuthenticationListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function __construct(TokenStorageInterface $tokenStorage, AuthenticationM
7272
$this->dispatcher = $dispatcher;
7373
}
7474

75-
$this->trustResolver = $trustResolver ?: new AuthenticationTrustResolver(AnonymousToken::class, RememberMeToken::class);
75+
$this->trustResolver = $trustResolver ?? new AuthenticationTrustResolver(AnonymousToken::class, RememberMeToken::class);
7676
}
7777

7878
/**

Http/Tests/Firewall/ContextListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ protected function runSessionOnKernelResponse($newToken, $original = null)
405405

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

Http/Tests/Firewall/ExceptionListenerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public function getAccessDeniedExceptionProvider()
184184
private function createEntryPoint(Response $response = null)
185185
{
186186
$entryPoint = $this->createMock(AuthenticationEntryPointInterface::class);
187-
$entryPoint->expects($this->once())->method('start')->willReturn($response ?: new Response('OK'));
187+
$entryPoint->expects($this->once())->method('start')->willReturn($response ?? new Response('OK'));
188188

189189
return $entryPoint;
190190
}
@@ -209,9 +209,9 @@ private function createEvent(\Exception $exception, $kernel = null)
209209
private function createExceptionListener(TokenStorageInterface $tokenStorage = null, AuthenticationTrustResolverInterface $trustResolver = null, HttpUtils $httpUtils = null, AuthenticationEntryPointInterface $authenticationEntryPoint = null, $errorPage = null, AccessDeniedHandlerInterface $accessDeniedHandler = null)
210210
{
211211
return new ExceptionListener(
212-
$tokenStorage ?: $this->createMock(TokenStorageInterface::class),
213-
$trustResolver ?: $this->createMock(AuthenticationTrustResolverInterface::class),
214-
$httpUtils ?: $this->createMock(HttpUtils::class),
212+
$tokenStorage ?? $this->createMock(TokenStorageInterface::class),
213+
$trustResolver ?? $this->createMock(AuthenticationTrustResolverInterface::class),
214+
$httpUtils ?? $this->createMock(HttpUtils::class),
215215
'key',
216216
$authenticationEntryPoint,
217217
$errorPage,

0 commit comments

Comments
 (0)