Skip to content

Commit d974526

Browse files
Merge branch '6.4' into 7.0
* 6.4: Fix implicitly-required parameters minor #53524 [Messenger] [AmazonSqs] Allow `async-aws/sqs` version 2 (smoench) Fix bad merge List CS fix in .git-blame-ignore-revs Fix implicitly-required parameters List CS fix in .git-blame-ignore-revs Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value [Messenger][AmazonSqs] Allow async-aws/sqs version 2
2 parents ab2a67c + d1962d0 commit d974526

Some content is hidden

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

46 files changed

+61
-61
lines changed

AccessMap.php

+1-1
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): void
31+
public function add(RequestMatcherInterface $requestMatcher, array $attributes = [], ?string $channel = null): void
3232
{
3333
$this->map[] = [$requestMatcher, $attributes, $channel];
3434
}

Authentication/AuthenticatorManager.php

+1-1
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class DefaultAuthenticationFailureHandler implements AuthenticationFailureHandle
4343
'failure_path_parameter' => '_failure_path',
4444
];
4545

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

Authentication/DefaultAuthenticationSuccessHandler.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class DefaultAuthenticationSuccessHandler implements AuthenticationSuccessHandle
4545
/**
4646
* @param array $options Options for processing a successful authentication attempt
4747
*/
48-
public function __construct(HttpUtils $httpUtils, array $options = [], LoggerInterface $logger = null)
48+
public function __construct(HttpUtils $httpUtils, array $options = [], ?LoggerInterface $logger = null)
4949
{
5050
$this->httpUtils = $httpUtils;
5151
$this->logger = $logger;

Authenticator/AbstractLoginFormAuthenticator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio
6060
* Override to control what happens when the user hits a secure page
6161
* but isn't logged in yet.
6262
*/
63-
public function start(Request $request, AuthenticationException $authException = null): Response
63+
public function start(Request $request, ?AuthenticationException $authException = null): Response
6464
{
6565
$url = $this->getLoginUrl($request);
6666

Authenticator/AbstractPreAuthenticatedAuthenticator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ abstract class AbstractPreAuthenticatedAuthenticator implements InteractiveAuthe
4141
private string $firewallName;
4242
private ?LoggerInterface $logger;
4343

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

Authenticator/AccessTokenAuthenticator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function setTranslator(?TranslatorInterface $translator): void
103103
/**
104104
* @see https://datatracker.ietf.org/doc/html/rfc6750#section-3
105105
*/
106-
private function getAuthenticateHeader(string $errorDescription = null): string
106+
private function getAuthenticateHeader(?string $errorDescription = null): string
107107
{
108108
$data = [
109109
'realm' => $this->realm,

Authenticator/Debug/TraceableAuthenticator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio
9292
return $this->authenticator->onAuthenticationFailure($request, $exception);
9393
}
9494

95-
public function start(Request $request, AuthenticationException $authException = null): Response
95+
public function start(Request $request, ?AuthenticationException $authException = null): Response
9696
{
9797
if (!$this->authenticator instanceof AuthenticationEntryPointInterface) {
9898
throw new NotAnEntryPointException();

Authenticator/FormLoginAuthenticator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public function setHttpKernel(HttpKernelInterface $httpKernel): void
143143
$this->httpKernel = $httpKernel;
144144
}
145145

146-
public function start(Request $request, AuthenticationException $authException = null): Response
146+
public function start(Request $request, ?AuthenticationException $authException = null): Response
147147
{
148148
if (!$this->options['use_forward']) {
149149
return parent::start($request, $authException);

Authenticator/HttpBasicAuthenticator.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ class HttpBasicAuthenticator implements AuthenticatorInterface, AuthenticationEn
3737
private UserProviderInterface $userProvider;
3838
private ?LoggerInterface $logger;
3939

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

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

Authenticator/JsonLoginAuthenticator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class JsonLoginAuthenticator implements InteractiveAuthenticatorInterface
5252
private ?AuthenticationFailureHandlerInterface $failureHandler;
5353
private ?TranslatorInterface $translator = null;
5454

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

Authenticator/Passport/Badge/PasswordUpgradeBadge.php

+1-1
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(#[\SensitiveParameter] string $plaintextPassword, PasswordUpgraderInterface $passwordUpgrader = null)
35+
public function __construct(#[\SensitiveParameter] string $plaintextPassword, ?PasswordUpgraderInterface $passwordUpgrader = null)
3636
{
3737
$this->plaintextPassword = $plaintextPassword;
3838
$this->passwordUpgrader = $passwordUpgrader;

Authenticator/Passport/Badge/UserBadge.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class UserBadge implements BadgeInterface
4949
* is thrown). If this is not set, the default user provider will be used with
5050
* $userIdentifier as username.
5151
*/
52-
public function __construct(string $userIdentifier, callable $userLoader = null, array $attributes = null)
52+
public function __construct(string $userIdentifier, ?callable $userLoader = null, ?array $attributes = null)
5353
{
5454
if (\strlen($userIdentifier) > self::MAX_USERNAME_LENGTH) {
5555
throw new BadCredentialsException('Username too long.');

Authenticator/Passport/Passport.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function getUser(): UserInterface
7272
*
7373
* @return $this
7474
*/
75-
public function addBadge(BadgeInterface $badge, string $badgeFqcn = null): static
75+
public function addBadge(BadgeInterface $badge, ?string $badgeFqcn = null): static
7676
{
7777
$badgeFqcn ??= $badge::class;
7878

Authenticator/RememberMeAuthenticator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class RememberMeAuthenticator implements InteractiveAuthenticatorInterface
5050
private string $cookieName;
5151
private ?LoggerInterface $logger;
5252

53-
public function __construct(RememberMeHandlerInterface $rememberMeHandler, #[\SensitiveParameter] string $secret, TokenStorageInterface $tokenStorage, string $cookieName, LoggerInterface $logger = null)
53+
public function __construct(RememberMeHandlerInterface $rememberMeHandler, #[\SensitiveParameter] string $secret, TokenStorageInterface $tokenStorage, string $cookieName, ?LoggerInterface $logger = null)
5454
{
5555
if (!$secret) {
5656
throw new InvalidArgumentException('A non-empty secret is required.');

Authenticator/RemoteUserAuthenticator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final class RemoteUserAuthenticator extends AbstractPreAuthenticatedAuthenticato
3030
{
3131
private string $userKey;
3232

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

Authenticator/X509Authenticator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class X509Authenticator extends AbstractPreAuthenticatedAuthenticator
3232
private string $credentialsKey;
3333
private string $credentialUserIdentifier;
3434

35-
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, string $credentialUserIdentifier = 'emailAddress')
35+
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, string $credentialUserIdentifier = 'emailAddress')
3636
{
3737
parent::__construct($userProvider, $tokenStorage, $firewallName, $logger);
3838

EntryPoint/AuthenticationEntryPointInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ interface AuthenticationEntryPointInterface
4040
*
4141
* return new Response('Auth header required', 401);
4242
*/
43-
public function start(Request $request, AuthenticationException $authException = null): Response;
43+
public function start(Request $request, ?AuthenticationException $authException = null): Response;
4444
}

Event/LoginFailureEvent.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class LoginFailureEvent extends Event
3636
private string $firewallName;
3737
private ?Passport $passport;
3838

39-
public function __construct(AuthenticationException $exception, AuthenticatorInterface $authenticator, Request $request, ?Response $response, string $firewallName, Passport $passport = null)
39+
public function __construct(AuthenticationException $exception, AuthenticatorInterface $authenticator, Request $request, ?Response $response, string $firewallName, ?Passport $passport = null)
4040
{
4141
$this->exception = $exception;
4242
$this->authenticator = $authenticator;

Event/LoginSuccessEvent.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class LoginSuccessEvent extends Event
4040
private ?Response $response;
4141
private string $firewallName;
4242

43-
public function __construct(AuthenticatorInterface $authenticator, Passport $passport, TokenInterface $authenticatedToken, Request $request, ?Response $response, string $firewallName, TokenInterface $previousToken = null)
43+
public function __construct(AuthenticatorInterface $authenticator, Passport $passport, TokenInterface $authenticatedToken, Request $request, ?Response $response, string $firewallName, ?TokenInterface $previousToken = null)
4444
{
4545
$this->authenticator = $authenticator;
4646
$this->passport = $passport;

Event/SwitchUserEvent.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ final class SwitchUserEvent extends Event
2727
private UserInterface $targetUser;
2828
private ?TokenInterface $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

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class CheckRememberMeConditionsListener implements EventSubscriberInterface
3838
private array $options;
3939
private ?LoggerInterface $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

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class RememberMeListener implements EventSubscriberInterface
3737
private RememberMeHandlerInterface $rememberMeHandler;
3838
private ?LoggerInterface $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/ChannelListener.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ChannelListener extends AbstractListener
3232
private int $httpPort;
3333
private int $httpsPort;
3434

35-
public function __construct(AccessMapInterface $map, LoggerInterface $logger = null, int $httpPort = 80, int $httpsPort = 443)
35+
public function __construct(AccessMapInterface $map, ?LoggerInterface $logger = null, int $httpPort = 80, int $httpsPort = 443)
3636
{
3737
$this->map = $map;
3838
$this->logger = $logger;

Firewall/ContextListener.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class ContextListener extends AbstractListener
5555
/**
5656
* @param iterable<mixed, UserProviderInterface> $userProviders
5757
*/
58-
public function __construct(TokenStorageInterface $tokenStorage, iterable $userProviders, string $contextKey, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null, AuthenticationTrustResolverInterface $trustResolver = null, callable $sessionTrackerEnabler = null)
58+
public function __construct(TokenStorageInterface $tokenStorage, iterable $userProviders, string $contextKey, ?LoggerInterface $logger = null, ?EventDispatcherInterface $dispatcher = null, ?AuthenticationTrustResolverInterface $trustResolver = null, ?callable $sessionTrackerEnabler = null)
5959
{
6060
if (empty($contextKey)) {
6161
throw new \InvalidArgumentException('$contextKey must not be empty.');

Firewall/ExceptionListener.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class ExceptionListener
5757
private HttpUtils $httpUtils;
5858
private bool $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

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class LogoutListener extends AbstractListener
4141
/**
4242
* @param array $options An array of options to process a logout attempt
4343
*/
44-
public function __construct(TokenStorageInterface $tokenStorage, HttpUtils $httpUtils, EventDispatcherInterface $eventDispatcher, array $options = [], CsrfTokenManagerInterface $csrfTokenManager = null)
44+
public function __construct(TokenStorageInterface $tokenStorage, HttpUtils $httpUtils, EventDispatcherInterface $eventDispatcher, array $options = [], ?CsrfTokenManagerInterface $csrfTokenManager = null)
4545
{
4646
$this->tokenStorage = $tokenStorage;
4747
$this->httpUtils = $httpUtils;

Firewall/SwitchUserListener.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class SwitchUserListener extends AbstractListener
5555
private ?UrlGeneratorInterface $urlGenerator;
5656
private ?string $targetRoute;
5757

58-
public function __construct(TokenStorageInterface $tokenStorage, UserProviderInterface $provider, UserCheckerInterface $userChecker, string $firewallName, AccessDecisionManagerInterface $accessDecisionManager, LoggerInterface $logger = null, string $usernameParameter = '_switch_user', string $role = 'ROLE_ALLOWED_TO_SWITCH', EventDispatcherInterface $dispatcher = null, bool $stateless = false, UrlGeneratorInterface $urlGenerator = null, string $targetRoute = null)
58+
public function __construct(TokenStorageInterface $tokenStorage, UserProviderInterface $provider, UserCheckerInterface $userChecker, string $firewallName, AccessDecisionManagerInterface $accessDecisionManager, ?LoggerInterface $logger = null, string $usernameParameter = '_switch_user', string $role = 'ROLE_ALLOWED_TO_SWITCH', ?EventDispatcherInterface $dispatcher = null, bool $stateless = false, ?UrlGeneratorInterface $urlGenerator = null, ?string $targetRoute = null)
5959
{
6060
if ('' === $firewallName) {
6161
throw new \InvalidArgumentException('$firewallName must not be empty.');

FirewallMap.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class FirewallMap implements FirewallMapInterface
3232
/**
3333
* @param list<callable> $listeners
3434
*/
35-
public function add(RequestMatcherInterface $requestMatcher = null, array $listeners = [], ExceptionListener $exceptionListener = null, LogoutListener $logoutListener = null): void
35+
public function add(?RequestMatcherInterface $requestMatcher = null, array $listeners = [], ?ExceptionListener $exceptionListener = null, ?LogoutListener $logoutListener = null): void
3636
{
3737
$this->map[] = [$requestMatcher, $listeners, $exceptionListener, $logoutListener];
3838
}

HttpUtils.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class HttpUtils
3737
*
3838
* @throws \InvalidArgumentException
3939
*/
40-
public function __construct(UrlGeneratorInterface $urlGenerator = null, UrlMatcherInterface|RequestMatcherInterface $urlMatcher = null, string $domainRegexp = null, string $secureDomainRegexp = null)
40+
public function __construct(?UrlGeneratorInterface $urlGenerator = null, UrlMatcherInterface|RequestMatcherInterface|null $urlMatcher = null, ?string $domainRegexp = null, ?string $secureDomainRegexp = null)
4141
{
4242
$this->urlGenerator = $urlGenerator;
4343
$this->urlMatcher = $urlMatcher;

Impersonate/ImpersonateUrlGenerator.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ public function generateImpersonationUrl(string $identifier): string
5050
return $request->getUriForPath($this->buildPath(null, $identifier));
5151
}
5252

53-
public function generateExitPath(string $targetUri = null): string
53+
public function generateExitPath(?string $targetUri = null): string
5454
{
5555
return $this->buildPath($targetUri);
5656
}
5757

58-
public function generateExitUrl(string $targetUri = null): string
58+
public function generateExitUrl(?string $targetUri = null): string
5959
{
6060
if (null === $request = $this->requestStack->getCurrentRequest()) {
6161
return '';
@@ -69,7 +69,7 @@ private function isImpersonatedUser(): bool
6969
return $this->tokenStorage->getToken() instanceof SwitchUserToken;
7070
}
7171

72-
private function buildPath(string $targetUri = null, string $identifier = SwitchUserListener::EXIT_VALUE): string
72+
private function buildPath(?string $targetUri = null, string $identifier = SwitchUserListener::EXIT_VALUE): string
7373
{
7474
if (null === ($request = $this->requestStack->getCurrentRequest())) {
7575
return '';

0 commit comments

Comments
 (0)