Skip to content

Commit 274a6ae

Browse files
Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
1 parent b762862 commit 274a6ae

File tree

57 files changed

+74
-74
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+74
-74
lines changed

AccessMap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class AccessMap implements AccessMapInterface
2828
* @param array $attributes An array of attributes to pass to the access decision manager (like roles)
2929
* @param string|null $channel The channel to enforce (http, https, or null)
3030
*/
31-
public function add(RequestMatcherInterface $requestMatcher, array $attributes = [], string $channel = null)
31+
public function add(RequestMatcherInterface $requestMatcher, array $attributes = [], ?string $channel = null)
3232
{
3333
$this->map[] = [$requestMatcher, $attributes, $channel];
3434
}

Authentication/AuthenticatorManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class AuthenticatorManager implements AuthenticatorManagerInterface, UserAuthent
5858
/**
5959
* @param iterable<mixed, AuthenticatorInterface> $authenticators
6060
*/
61-
public function __construct(iterable $authenticators, TokenStorageInterface $tokenStorage, EventDispatcherInterface $eventDispatcher, string $firewallName, LoggerInterface $logger = null, bool $eraseCredentials = true, bool $hideUserNotFoundExceptions = true, array $requiredBadges = [])
61+
public function __construct(iterable $authenticators, TokenStorageInterface $tokenStorage, EventDispatcherInterface $eventDispatcher, string $firewallName, ?LoggerInterface $logger = null, bool $eraseCredentials = true, bool $hideUserNotFoundExceptions = true, array $requiredBadges = [])
6262
{
6363
$this->authenticators = $authenticators;
6464
$this->tokenStorage = $tokenStorage;

Authentication/DefaultAuthenticationFailureHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class DefaultAuthenticationFailureHandler implements AuthenticationFailureHandle
4242
'failure_path_parameter' => '_failure_path',
4343
];
4444

45-
public function __construct(HttpKernelInterface $httpKernel, HttpUtils $httpUtils, array $options = [], LoggerInterface $logger = null)
45+
public function __construct(HttpKernelInterface $httpKernel, HttpUtils $httpUtils, array $options = [], ?LoggerInterface $logger = null)
4646
{
4747
$this->httpKernel = $httpKernel;
4848
$this->httpUtils = $httpUtils;

Authentication/DefaultAuthenticationSuccessHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class DefaultAuthenticationSuccessHandler implements AuthenticationSuccessHandle
4646
/**
4747
* @param array $options Options for processing a successful authentication attempt
4848
*/
49-
public function __construct(HttpUtils $httpUtils, array $options = [], LoggerInterface $logger = null)
49+
public function __construct(HttpUtils $httpUtils, array $options = [], ?LoggerInterface $logger = null)
5050
{
5151
$this->httpUtils = $httpUtils;
5252
$this->logger = $logger;

Authenticator/AbstractLoginFormAuthenticator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio
6262
* Override to control what happens when the user hits a secure page
6363
* but isn't logged in yet.
6464
*/
65-
public function start(Request $request, AuthenticationException $authException = null): Response
65+
public function start(Request $request, ?AuthenticationException $authException = null): Response
6666
{
6767
$url = $this->getLoginUrl($request);
6868

Authenticator/AbstractPreAuthenticatedAuthenticator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ abstract class AbstractPreAuthenticatedAuthenticator implements InteractiveAuthe
4242
private $firewallName;
4343
private $logger;
4444

45-
public function __construct(UserProviderInterface $userProvider, TokenStorageInterface $tokenStorage, string $firewallName, LoggerInterface $logger = null)
45+
public function __construct(UserProviderInterface $userProvider, TokenStorageInterface $tokenStorage, string $firewallName, ?LoggerInterface $logger = null)
4646
{
4747
$this->userProvider = $userProvider;
4848
$this->tokenStorage = $tokenStorage;

Authenticator/Debug/TraceableAuthenticator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio
8686
return $this->authenticator->onAuthenticationFailure($request, $exception);
8787
}
8888

89-
public function start(Request $request, AuthenticationException $authException = null): Response
89+
public function start(Request $request, ?AuthenticationException $authException = null): Response
9090
{
9191
if (!$this->authenticator instanceof AuthenticationEntryPointInterface) {
9292
throw new NotAnEntryPointException();

Authenticator/FormLoginAuthenticator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public function setHttpKernel(HttpKernelInterface $httpKernel): void
169169
$this->httpKernel = $httpKernel;
170170
}
171171

172-
public function start(Request $request, AuthenticationException $authException = null): Response
172+
public function start(Request $request, ?AuthenticationException $authException = null): Response
173173
{
174174
if (!$this->options['use_forward']) {
175175
return parent::start($request, $authException);

Authenticator/HttpBasicAuthenticator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ class HttpBasicAuthenticator implements AuthenticatorInterface, AuthenticationEn
3838
private $userProvider;
3939
private $logger;
4040

41-
public function __construct(string $realmName, UserProviderInterface $userProvider, LoggerInterface $logger = null)
41+
public function __construct(string $realmName, UserProviderInterface $userProvider, ?LoggerInterface $logger = null)
4242
{
4343
$this->realmName = $realmName;
4444
$this->userProvider = $userProvider;
4545
$this->logger = $logger;
4646
}
4747

48-
public function start(Request $request, AuthenticationException $authException = null): Response
48+
public function start(Request $request, ?AuthenticationException $authException = null): Response
4949
{
5050
$response = new Response();
5151
$response->headers->set('WWW-Authenticate', sprintf('Basic realm="%s"', $this->realmName));

Authenticator/JsonLoginAuthenticator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class JsonLoginAuthenticator implements InteractiveAuthenticatorInterface
5858
*/
5959
private $translator;
6060

61-
public function __construct(HttpUtils $httpUtils, UserProviderInterface $userProvider, AuthenticationSuccessHandlerInterface $successHandler = null, AuthenticationFailureHandlerInterface $failureHandler = null, array $options = [], PropertyAccessorInterface $propertyAccessor = null)
61+
public function __construct(HttpUtils $httpUtils, UserProviderInterface $userProvider, ?AuthenticationSuccessHandlerInterface $successHandler = null, ?AuthenticationFailureHandlerInterface $failureHandler = null, array $options = [], ?PropertyAccessorInterface $propertyAccessor = null)
6262
{
6363
$this->options = array_merge(['username_path' => 'username', 'password_path' => 'password'], $options);
6464
$this->httpUtils = $httpUtils;

Authenticator/Passport/Badge/PasswordUpgradeBadge.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class PasswordUpgradeBadge implements BadgeInterface
3232
* @param string $plaintextPassword The presented password, used in the rehash
3333
* @param PasswordUpgraderInterface|null $passwordUpgrader The password upgrader, defaults to the UserProvider if null
3434
*/
35-
public function __construct(string $plaintextPassword, PasswordUpgraderInterface $passwordUpgrader = null)
35+
public function __construct(string $plaintextPassword, ?PasswordUpgraderInterface $passwordUpgrader = null)
3636
{
3737
$this->plaintextPassword = $plaintextPassword;
3838
$this->passwordUpgrader = $passwordUpgrader;

Authenticator/Passport/Badge/UserBadge.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class UserBadge implements BadgeInterface
4444
* is thrown). If this is not set, the default user provider will be used with
4545
* $userIdentifier as username.
4646
*/
47-
public function __construct(string $userIdentifier, callable $userLoader = null)
47+
public function __construct(string $userIdentifier, ?callable $userLoader = null)
4848
{
4949
$this->userIdentifier = $userIdentifier;
5050
$this->userLoader = $userLoader;

Authenticator/RememberMeAuthenticator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class RememberMeAuthenticator implements InteractiveAuthenticatorInterface
5050
private $cookieName;
5151
private $logger;
5252

53-
public function __construct(RememberMeHandlerInterface $rememberMeHandler, string $secret, TokenStorageInterface $tokenStorage, string $cookieName, LoggerInterface $logger = null)
53+
public function __construct(RememberMeHandlerInterface $rememberMeHandler, string $secret, TokenStorageInterface $tokenStorage, string $cookieName, ?LoggerInterface $logger = null)
5454
{
5555
$this->rememberMeHandler = $rememberMeHandler;
5656
$this->secret = $secret;

Authenticator/RemoteUserAuthenticator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class RemoteUserAuthenticator extends AbstractPreAuthenticatedAuthenticator
3232
{
3333
private $userKey;
3434

35-
public function __construct(UserProviderInterface $userProvider, TokenStorageInterface $tokenStorage, string $firewallName, string $userKey = 'REMOTE_USER', LoggerInterface $logger = null)
35+
public function __construct(UserProviderInterface $userProvider, TokenStorageInterface $tokenStorage, string $firewallName, string $userKey = 'REMOTE_USER', ?LoggerInterface $logger = null)
3636
{
3737
parent::__construct($userProvider, $tokenStorage, $firewallName, $logger);
3838

Authenticator/X509Authenticator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class X509Authenticator extends AbstractPreAuthenticatedAuthenticator
3131
private $userKey;
3232
private $credentialsKey;
3333

34-
public function __construct(UserProviderInterface $userProvider, TokenStorageInterface $tokenStorage, string $firewallName, string $userKey = 'SSL_CLIENT_S_DN_Email', string $credentialsKey = 'SSL_CLIENT_S_DN', LoggerInterface $logger = null)
34+
public function __construct(UserProviderInterface $userProvider, TokenStorageInterface $tokenStorage, string $firewallName, string $userKey = 'SSL_CLIENT_S_DN_Email', string $credentialsKey = 'SSL_CLIENT_S_DN', ?LoggerInterface $logger = null)
3535
{
3636
parent::__construct($userProvider, $tokenStorage, $firewallName, $logger);
3737

EntryPoint/AuthenticationEntryPointInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ interface AuthenticationEntryPointInterface
4242
*
4343
* @return Response
4444
*/
45-
public function start(Request $request, AuthenticationException $authException = null);
45+
public function start(Request $request, ?AuthenticationException $authException = null);
4646
}

EntryPoint/BasicAuthenticationEntryPoint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct(string $realmName)
3737
/**
3838
* {@inheritdoc}
3939
*/
40-
public function start(Request $request, AuthenticationException $authException = null)
40+
public function start(Request $request, ?AuthenticationException $authException = null)
4141
{
4242
$response = new Response();
4343
$response->headers->set('WWW-Authenticate', sprintf('Basic realm="%s"', $this->realmName));

EntryPoint/FormAuthenticationEntryPoint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct(HttpKernelInterface $kernel, HttpUtils $httpUtils, s
4848
/**
4949
* {@inheritdoc}
5050
*/
51-
public function start(Request $request, AuthenticationException $authException = null)
51+
public function start(Request $request, ?AuthenticationException $authException = null)
5252
{
5353
if ($this->useForward) {
5454
$subRequest = $this->httpUtils->createRequest($request, $this->loginPath);

EntryPoint/RetryAuthenticationEntryPoint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct(int $httpPort = 80, int $httpsPort = 443)
4141
/**
4242
* {@inheritdoc}
4343
*/
44-
public function start(Request $request, AuthenticationException $authException = null)
44+
public function start(Request $request, ?AuthenticationException $authException = null)
4545
{
4646
$scheme = $request->isSecure() ? 'http' : 'https';
4747
if ('http' === $scheme && 80 != $this->httpPort) {

Event/LoginFailureEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class LoginFailureEvent extends Event
3939
/**
4040
* @param Passport|null $passport
4141
*/
42-
public function __construct(AuthenticationException $exception, AuthenticatorInterface $authenticator, Request $request, ?Response $response, string $firewallName, PassportInterface $passport = null)
42+
public function __construct(AuthenticationException $exception, AuthenticatorInterface $authenticator, Request $request, ?Response $response, string $firewallName, ?PassportInterface $passport = null)
4343
{
4444
if (null !== $passport && !$passport instanceof Passport) {
4545
trigger_deprecation('symfony/security-http', '5.4', 'Not passing an instance of "%s" or "null" as "$passport" argument of "%s()" is deprecated, "%s" given.', Passport::class, __METHOD__, get_debug_type($passport));

Event/LoginSuccessEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class LoginSuccessEvent extends Event
4545
/**
4646
* @param Passport $passport
4747
*/
48-
public function __construct(AuthenticatorInterface $authenticator, PassportInterface $passport, TokenInterface $authenticatedToken, Request $request, ?Response $response, string $firewallName, TokenInterface $previousToken = null)
48+
public function __construct(AuthenticatorInterface $authenticator, PassportInterface $passport, TokenInterface $authenticatedToken, Request $request, ?Response $response, string $firewallName, ?TokenInterface $previousToken = null)
4949
{
5050
if (!$passport instanceof Passport) {
5151
trigger_deprecation('symfony/security-http', '5.4', 'Not passing an instance of "%s" as "$passport" argument of "%s()" is deprecated, "%s" given.', Passport::class, __METHOD__, get_debug_type($passport));

Event/SwitchUserEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ final class SwitchUserEvent extends Event
2727
private $targetUser;
2828
private $token;
2929

30-
public function __construct(Request $request, UserInterface $targetUser, TokenInterface $token = null)
30+
public function __construct(Request $request, UserInterface $targetUser, ?TokenInterface $token = null)
3131
{
3232
$this->request = $request;
3333
$this->targetUser = $targetUser;

EventListener/CheckRememberMeConditionsListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class CheckRememberMeConditionsListener implements EventSubscriberInterface
3838
private $options;
3939
private $logger;
4040

41-
public function __construct(array $options = [], LoggerInterface $logger = null)
41+
public function __construct(array $options = [], ?LoggerInterface $logger = null)
4242
{
4343
$this->options = $options + ['always_remember_me' => false, 'remember_me_parameter' => '_remember_me'];
4444
$this->logger = $logger;

EventListener/RememberMeListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class RememberMeListener implements EventSubscriberInterface
3737
private $rememberMeHandler;
3838
private $logger;
3939

40-
public function __construct(RememberMeHandlerInterface $rememberMeHandler, LoggerInterface $logger = null)
40+
public function __construct(RememberMeHandlerInterface $rememberMeHandler, ?LoggerInterface $logger = null)
4141
{
4242
$this->rememberMeHandler = $rememberMeHandler;
4343
$this->logger = $logger;

Firewall/AbstractAuthenticationListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ abstract class AbstractAuthenticationListener extends AbstractListener
7070
/**
7171
* @throws \InvalidArgumentException
7272
*/
73-
public function __construct(TokenStorageInterface $tokenStorage, AuthenticationManagerInterface $authenticationManager, SessionAuthenticationStrategyInterface $sessionStrategy, HttpUtils $httpUtils, string $providerKey, AuthenticationSuccessHandlerInterface $successHandler, AuthenticationFailureHandlerInterface $failureHandler, array $options = [], LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null)
73+
public function __construct(TokenStorageInterface $tokenStorage, AuthenticationManagerInterface $authenticationManager, SessionAuthenticationStrategyInterface $sessionStrategy, HttpUtils $httpUtils, string $providerKey, AuthenticationSuccessHandlerInterface $successHandler, AuthenticationFailureHandlerInterface $failureHandler, array $options = [], ?LoggerInterface $logger = null, ?EventDispatcherInterface $dispatcher = null)
7474
{
7575
if (empty($providerKey)) {
7676
throw new \InvalidArgumentException('$providerKey must not be empty.');

Firewall/AbstractPreAuthenticatedListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ abstract class AbstractPreAuthenticatedListener extends AbstractListener
4747
private $dispatcher;
4848
private $sessionStrategy;
4949

50-
public function __construct(TokenStorageInterface $tokenStorage, AuthenticationManagerInterface $authenticationManager, string $providerKey, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null)
50+
public function __construct(TokenStorageInterface $tokenStorage, AuthenticationManagerInterface $authenticationManager, string $providerKey, ?LoggerInterface $logger = null, ?EventDispatcherInterface $dispatcher = null)
5151
{
5252
$this->tokenStorage = $tokenStorage;
5353
$this->authenticationManager = $authenticationManager;

Firewall/AnonymousAuthenticationListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class AnonymousAuthenticationListener extends AbstractListener
3939
private $authenticationManager;
4040
private $logger;
4141

42-
public function __construct(TokenStorageInterface $tokenStorage, string $secret, LoggerInterface $logger = null, AuthenticationManagerInterface $authenticationManager = null)
42+
public function __construct(TokenStorageInterface $tokenStorage, string $secret, ?LoggerInterface $logger = null, ?AuthenticationManagerInterface $authenticationManager = null)
4343
{
4444
$this->tokenStorage = $tokenStorage;
4545
$this->secret = $secret;

Firewall/BasicAuthenticationListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class BasicAuthenticationListener extends AbstractListener
4343
private $ignoreFailure;
4444
private $sessionStrategy;
4545

46-
public function __construct(TokenStorageInterface $tokenStorage, AuthenticationManagerInterface $authenticationManager, string $providerKey, AuthenticationEntryPointInterface $authenticationEntryPoint, LoggerInterface $logger = null)
46+
public function __construct(TokenStorageInterface $tokenStorage, AuthenticationManagerInterface $authenticationManager, string $providerKey, AuthenticationEntryPointInterface $authenticationEntryPoint, ?LoggerInterface $logger = null)
4747
{
4848
if (empty($providerKey)) {
4949
throw new \InvalidArgumentException('$providerKey must not be empty.');

Firewall/ContextListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class ContextListener extends AbstractListener
6060
/**
6161
* @param iterable<mixed, UserProviderInterface> $userProviders
6262
*/
63-
public function __construct(TokenStorageInterface $tokenStorage, iterable $userProviders, string $contextKey, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null, AuthenticationTrustResolverInterface $trustResolver = null, callable $sessionTrackerEnabler = null)
63+
public function __construct(TokenStorageInterface $tokenStorage, iterable $userProviders, string $contextKey, ?LoggerInterface $logger = null, ?EventDispatcherInterface $dispatcher = null, ?AuthenticationTrustResolverInterface $trustResolver = null, ?callable $sessionTrackerEnabler = null)
6464
{
6565
if (empty($contextKey)) {
6666
throw new \InvalidArgumentException('$contextKey must not be empty.');

Firewall/ExceptionListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class ExceptionListener
5757
private $httpUtils;
5858
private $stateless;
5959

60-
public function __construct(TokenStorageInterface $tokenStorage, AuthenticationTrustResolverInterface $trustResolver, HttpUtils $httpUtils, string $firewallName, AuthenticationEntryPointInterface $authenticationEntryPoint = null, string $errorPage = null, AccessDeniedHandlerInterface $accessDeniedHandler = null, LoggerInterface $logger = null, bool $stateless = false)
60+
public function __construct(TokenStorageInterface $tokenStorage, AuthenticationTrustResolverInterface $trustResolver, HttpUtils $httpUtils, string $firewallName, ?AuthenticationEntryPointInterface $authenticationEntryPoint = null, ?string $errorPage = null, ?AccessDeniedHandlerInterface $accessDeniedHandler = null, ?LoggerInterface $logger = null, bool $stateless = false)
6161
{
6262
$this->tokenStorage = $tokenStorage;
6363
$this->accessDeniedHandler = $accessDeniedHandler;

Firewall/LogoutListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class LogoutListener extends AbstractListener
4646
* @param EventDispatcherInterface $eventDispatcher
4747
* @param array $options An array of options to process a logout attempt
4848
*/
49-
public function __construct(TokenStorageInterface $tokenStorage, HttpUtils $httpUtils, $eventDispatcher, array $options = [], CsrfTokenManagerInterface $csrfTokenManager = null)
49+
public function __construct(TokenStorageInterface $tokenStorage, HttpUtils $httpUtils, $eventDispatcher, array $options = [], ?CsrfTokenManagerInterface $csrfTokenManager = null)
5050
{
5151
if (!$eventDispatcher instanceof EventDispatcherInterface) {
5252
trigger_deprecation('symfony/security-http', '5.1', 'Passing a logout success handler to "%s" is deprecated, pass an instance of "%s" instead.', __METHOD__, EventDispatcherInterface::class);

0 commit comments

Comments
 (0)