Skip to content

Commit

Permalink
Merge branch '6.3' into 6.4
Browse files Browse the repository at this point in the history
* 6.3:
  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
  • Loading branch information
nicolas-grekas committed Jan 23, 2024
2 parents d82bf7c + 09eb813 commit d1962d0
Show file tree
Hide file tree
Showing 44 changed files with 59 additions and 59 deletions.
2 changes: 1 addition & 1 deletion AccessMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class AccessMap implements AccessMapInterface
*
* @return void
*/
public function add(RequestMatcherInterface $requestMatcher, array $attributes = [], string $channel = null)
public function add(RequestMatcherInterface $requestMatcher, array $attributes = [], ?string $channel = null)
{
$this->map[] = [$requestMatcher, $attributes, $channel];
}
Expand Down
2 changes: 1 addition & 1 deletion Authentication/AuthenticatorManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class AuthenticatorManager implements AuthenticatorManagerInterface, UserAuthent
/**
* @param iterable<mixed, AuthenticatorInterface> $authenticators
*/
public function __construct(iterable $authenticators, TokenStorageInterface $tokenStorage, EventDispatcherInterface $eventDispatcher, string $firewallName, LoggerInterface $logger = null, bool $eraseCredentials = true, bool $hideUserNotFoundExceptions = true, array $requiredBadges = [])
public function __construct(iterable $authenticators, TokenStorageInterface $tokenStorage, EventDispatcherInterface $eventDispatcher, string $firewallName, ?LoggerInterface $logger = null, bool $eraseCredentials = true, bool $hideUserNotFoundExceptions = true, array $requiredBadges = [])
{
$this->authenticators = $authenticators;
$this->tokenStorage = $tokenStorage;
Expand Down
2 changes: 1 addition & 1 deletion Authentication/DefaultAuthenticationFailureHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class DefaultAuthenticationFailureHandler implements AuthenticationFailureHandle
'failure_path_parameter' => '_failure_path',
];

public function __construct(HttpKernelInterface $httpKernel, HttpUtils $httpUtils, array $options = [], LoggerInterface $logger = null)
public function __construct(HttpKernelInterface $httpKernel, HttpUtils $httpUtils, array $options = [], ?LoggerInterface $logger = null)
{
$this->httpKernel = $httpKernel;
$this->httpUtils = $httpUtils;
Expand Down
2 changes: 1 addition & 1 deletion Authentication/DefaultAuthenticationSuccessHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class DefaultAuthenticationSuccessHandler implements AuthenticationSuccessHandle
/**
* @param array $options Options for processing a successful authentication attempt
*/
public function __construct(HttpUtils $httpUtils, array $options = [], LoggerInterface $logger = null)
public function __construct(HttpUtils $httpUtils, array $options = [], ?LoggerInterface $logger = null)
{
$this->httpUtils = $httpUtils;
$this->logger = $logger;
Expand Down
2 changes: 1 addition & 1 deletion Authenticator/AbstractLoginFormAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio
* Override to control what happens when the user hits a secure page
* but isn't logged in yet.
*/
public function start(Request $request, AuthenticationException $authException = null): Response
public function start(Request $request, ?AuthenticationException $authException = null): Response
{
$url = $this->getLoginUrl($request);

Expand Down
2 changes: 1 addition & 1 deletion Authenticator/AbstractPreAuthenticatedAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ abstract class AbstractPreAuthenticatedAuthenticator implements InteractiveAuthe
private string $firewallName;
private ?LoggerInterface $logger;

public function __construct(UserProviderInterface $userProvider, TokenStorageInterface $tokenStorage, string $firewallName, LoggerInterface $logger = null)
public function __construct(UserProviderInterface $userProvider, TokenStorageInterface $tokenStorage, string $firewallName, ?LoggerInterface $logger = null)
{
$this->userProvider = $userProvider;
$this->tokenStorage = $tokenStorage;
Expand Down
2 changes: 1 addition & 1 deletion Authenticator/AccessTokenAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function setTranslator(?TranslatorInterface $translator)
/**
* @see https://datatracker.ietf.org/doc/html/rfc6750#section-3
*/
private function getAuthenticateHeader(string $errorDescription = null): string
private function getAuthenticateHeader(?string $errorDescription = null): string
{
$data = [
'realm' => $this->realm,
Expand Down
2 changes: 1 addition & 1 deletion Authenticator/Debug/TraceableAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio
return $this->authenticator->onAuthenticationFailure($request, $exception);
}

public function start(Request $request, AuthenticationException $authException = null): Response
public function start(Request $request, ?AuthenticationException $authException = null): Response
{
if (!$this->authenticator instanceof AuthenticationEntryPointInterface) {
throw new NotAnEntryPointException();
Expand Down
2 changes: 1 addition & 1 deletion Authenticator/FormLoginAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public function setHttpKernel(HttpKernelInterface $httpKernel): void
$this->httpKernel = $httpKernel;
}

public function start(Request $request, AuthenticationException $authException = null): Response
public function start(Request $request, ?AuthenticationException $authException = null): Response
{
if (!$this->options['use_forward']) {
return parent::start($request, $authException);
Expand Down
4 changes: 2 additions & 2 deletions Authenticator/HttpBasicAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ class HttpBasicAuthenticator implements AuthenticatorInterface, AuthenticationEn
private UserProviderInterface $userProvider;
private ?LoggerInterface $logger;

public function __construct(string $realmName, UserProviderInterface $userProvider, LoggerInterface $logger = null)
public function __construct(string $realmName, UserProviderInterface $userProvider, ?LoggerInterface $logger = null)
{
$this->realmName = $realmName;
$this->userProvider = $userProvider;
$this->logger = $logger;
}

public function start(Request $request, AuthenticationException $authException = null): Response
public function start(Request $request, ?AuthenticationException $authException = null): Response
{
$response = new Response();
$response->headers->set('WWW-Authenticate', sprintf('Basic realm="%s"', $this->realmName));
Expand Down
2 changes: 1 addition & 1 deletion Authenticator/JsonLoginAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class JsonLoginAuthenticator implements InteractiveAuthenticatorInterface
private ?AuthenticationFailureHandlerInterface $failureHandler;
private ?TranslatorInterface $translator = null;

public function __construct(HttpUtils $httpUtils, UserProviderInterface $userProvider, AuthenticationSuccessHandlerInterface $successHandler = null, AuthenticationFailureHandlerInterface $failureHandler = null, array $options = [], PropertyAccessorInterface $propertyAccessor = null)
public function __construct(HttpUtils $httpUtils, UserProviderInterface $userProvider, ?AuthenticationSuccessHandlerInterface $successHandler = null, ?AuthenticationFailureHandlerInterface $failureHandler = null, array $options = [], ?PropertyAccessorInterface $propertyAccessor = null)
{
$this->options = array_merge(['username_path' => 'username', 'password_path' => 'password'], $options);
$this->httpUtils = $httpUtils;
Expand Down
2 changes: 1 addition & 1 deletion Authenticator/Passport/Badge/PasswordUpgradeBadge.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class PasswordUpgradeBadge implements BadgeInterface
* @param string $plaintextPassword The presented password, used in the rehash
* @param PasswordUpgraderInterface|null $passwordUpgrader The password upgrader, defaults to the UserProvider if null
*/
public function __construct(#[\SensitiveParameter] string $plaintextPassword, PasswordUpgraderInterface $passwordUpgrader = null)
public function __construct(#[\SensitiveParameter] string $plaintextPassword, ?PasswordUpgraderInterface $passwordUpgrader = null)
{
$this->plaintextPassword = $plaintextPassword;
$this->passwordUpgrader = $passwordUpgrader;
Expand Down
2 changes: 1 addition & 1 deletion Authenticator/Passport/Badge/UserBadge.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class UserBadge implements BadgeInterface
* is thrown). If this is not set, the default user provider will be used with
* $userIdentifier as username.
*/
public function __construct(string $userIdentifier, callable $userLoader = null, array $attributes = null)
public function __construct(string $userIdentifier, ?callable $userLoader = null, ?array $attributes = null)
{
if (\strlen($userIdentifier) > self::MAX_USERNAME_LENGTH) {
throw new BadCredentialsException('Username too long.');
Expand Down
2 changes: 1 addition & 1 deletion Authenticator/RememberMeAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class RememberMeAuthenticator implements InteractiveAuthenticatorInterface
private string $cookieName;
private ?LoggerInterface $logger;

public function __construct(RememberMeHandlerInterface $rememberMeHandler, #[\SensitiveParameter] string $secret, TokenStorageInterface $tokenStorage, string $cookieName, LoggerInterface $logger = null)
public function __construct(RememberMeHandlerInterface $rememberMeHandler, #[\SensitiveParameter] string $secret, TokenStorageInterface $tokenStorage, string $cookieName, ?LoggerInterface $logger = null)
{
if (!$secret) {
throw new InvalidArgumentException('A non-empty secret is required.');
Expand Down
2 changes: 1 addition & 1 deletion Authenticator/RemoteUserAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class RemoteUserAuthenticator extends AbstractPreAuthenticatedAuthenticator
{
private string $userKey;

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

Expand Down
2 changes: 1 addition & 1 deletion Authenticator/X509Authenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class X509Authenticator extends AbstractPreAuthenticatedAuthenticator
private string $credentialsKey;
private string $credentialUserIdentifier;

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')
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')
{
parent::__construct($userProvider, $tokenStorage, $firewallName, $logger);

Expand Down
2 changes: 1 addition & 1 deletion EntryPoint/AuthenticationEntryPointInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ interface AuthenticationEntryPointInterface
*
* @return Response
*/
public function start(Request $request, AuthenticationException $authException = null);
public function start(Request $request, ?AuthenticationException $authException = null);
}
2 changes: 1 addition & 1 deletion Event/LoginFailureEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class LoginFailureEvent extends Event
private string $firewallName;
private ?Passport $passport;

public function __construct(AuthenticationException $exception, AuthenticatorInterface $authenticator, Request $request, ?Response $response, string $firewallName, Passport $passport = null)
public function __construct(AuthenticationException $exception, AuthenticatorInterface $authenticator, Request $request, ?Response $response, string $firewallName, ?Passport $passport = null)
{
$this->exception = $exception;
$this->authenticator = $authenticator;
Expand Down
2 changes: 1 addition & 1 deletion Event/LoginSuccessEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class LoginSuccessEvent extends Event
private ?Response $response;
private string $firewallName;

public function __construct(AuthenticatorInterface $authenticator, Passport $passport, TokenInterface $authenticatedToken, Request $request, ?Response $response, string $firewallName, TokenInterface $previousToken = null)
public function __construct(AuthenticatorInterface $authenticator, Passport $passport, TokenInterface $authenticatedToken, Request $request, ?Response $response, string $firewallName, ?TokenInterface $previousToken = null)
{
$this->authenticator = $authenticator;
$this->passport = $passport;
Expand Down
2 changes: 1 addition & 1 deletion Event/SwitchUserEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class SwitchUserEvent extends Event
private UserInterface $targetUser;
private ?TokenInterface $token;

public function __construct(Request $request, UserInterface $targetUser, TokenInterface $token = null)
public function __construct(Request $request, UserInterface $targetUser, ?TokenInterface $token = null)
{
$this->request = $request;
$this->targetUser = $targetUser;
Expand Down
2 changes: 1 addition & 1 deletion EventListener/CheckRememberMeConditionsListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class CheckRememberMeConditionsListener implements EventSubscriberInterface
private array $options;
private ?LoggerInterface $logger;

public function __construct(array $options = [], LoggerInterface $logger = null)
public function __construct(array $options = [], ?LoggerInterface $logger = null)
{
$this->options = $options + ['always_remember_me' => false, 'remember_me_parameter' => '_remember_me'];
$this->logger = $logger;
Expand Down
2 changes: 1 addition & 1 deletion EventListener/RememberMeListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class RememberMeListener implements EventSubscriberInterface
private RememberMeHandlerInterface $rememberMeHandler;
private ?LoggerInterface $logger;

public function __construct(RememberMeHandlerInterface $rememberMeHandler, LoggerInterface $logger = null)
public function __construct(RememberMeHandlerInterface $rememberMeHandler, ?LoggerInterface $logger = null)
{
$this->rememberMeHandler = $rememberMeHandler;
$this->logger = $logger;
Expand Down
2 changes: 1 addition & 1 deletion Firewall/ChannelListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ChannelListener extends AbstractListener
private int $httpPort;
private int $httpsPort;

public function __construct(AccessMapInterface $map, LoggerInterface $logger = null, int $httpPort = 80, int $httpsPort = 443)
public function __construct(AccessMapInterface $map, ?LoggerInterface $logger = null, int $httpPort = 80, int $httpsPort = 443)
{
$this->map = $map;
$this->logger = $logger;
Expand Down
2 changes: 1 addition & 1 deletion Firewall/ContextListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class ContextListener extends AbstractListener
/**
* @param iterable<mixed, UserProviderInterface> $userProviders
*/
public function __construct(TokenStorageInterface $tokenStorage, iterable $userProviders, string $contextKey, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null, AuthenticationTrustResolverInterface $trustResolver = null, callable $sessionTrackerEnabler = null)
public function __construct(TokenStorageInterface $tokenStorage, iterable $userProviders, string $contextKey, ?LoggerInterface $logger = null, ?EventDispatcherInterface $dispatcher = null, ?AuthenticationTrustResolverInterface $trustResolver = null, ?callable $sessionTrackerEnabler = null)
{
if (empty($contextKey)) {
throw new \InvalidArgumentException('$contextKey must not be empty.');
Expand Down
2 changes: 1 addition & 1 deletion Firewall/ExceptionListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ExceptionListener
private HttpUtils $httpUtils;
private bool $stateless;

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)
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)
{
$this->tokenStorage = $tokenStorage;
$this->accessDeniedHandler = $accessDeniedHandler;
Expand Down
2 changes: 1 addition & 1 deletion Firewall/LogoutListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class LogoutListener extends AbstractListener
/**
* @param array $options An array of options to process a logout attempt
*/
public function __construct(TokenStorageInterface $tokenStorage, HttpUtils $httpUtils, EventDispatcherInterface $eventDispatcher, array $options = [], CsrfTokenManagerInterface $csrfTokenManager = null)
public function __construct(TokenStorageInterface $tokenStorage, HttpUtils $httpUtils, EventDispatcherInterface $eventDispatcher, array $options = [], ?CsrfTokenManagerInterface $csrfTokenManager = null)
{
$this->tokenStorage = $tokenStorage;
$this->httpUtils = $httpUtils;
Expand Down
2 changes: 1 addition & 1 deletion Firewall/SwitchUserListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class SwitchUserListener extends AbstractListener
private ?UrlGeneratorInterface $urlGenerator;
private ?string $targetRoute;

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)
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)
{
if ('' === $firewallName) {
throw new \InvalidArgumentException('$firewallName must not be empty.');
Expand Down
2 changes: 1 addition & 1 deletion FirewallMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class FirewallMap implements FirewallMapInterface
*
* @return void
*/
public function add(RequestMatcherInterface $requestMatcher = null, array $listeners = [], ExceptionListener $exceptionListener = null, LogoutListener $logoutListener = null)
public function add(?RequestMatcherInterface $requestMatcher = null, array $listeners = [], ?ExceptionListener $exceptionListener = null, ?LogoutListener $logoutListener = null)
{
$this->map[] = [$requestMatcher, $listeners, $exceptionListener, $logoutListener];
}
Expand Down
2 changes: 1 addition & 1 deletion HttpUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class HttpUtils
*
* @throws \InvalidArgumentException
*/
public function __construct(UrlGeneratorInterface $urlGenerator = null, UrlMatcherInterface|RequestMatcherInterface $urlMatcher = null, string $domainRegexp = null, string $secureDomainRegexp = null)
public function __construct(?UrlGeneratorInterface $urlGenerator = null, UrlMatcherInterface|RequestMatcherInterface|null $urlMatcher = null, ?string $domainRegexp = null, ?string $secureDomainRegexp = null)
{
$this->urlGenerator = $urlGenerator;
$this->urlMatcher = $urlMatcher;
Expand Down
6 changes: 3 additions & 3 deletions Impersonate/ImpersonateUrlGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ public function generateImpersonationUrl(string $identifier): string
return $request->getUriForPath($this->buildPath(null, $identifier));
}

public function generateExitPath(string $targetUri = null): string
public function generateExitPath(?string $targetUri = null): string
{
return $this->buildPath($targetUri);
}

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

private function buildPath(string $targetUri = null, string $identifier = SwitchUserListener::EXIT_VALUE): string
private function buildPath(?string $targetUri = null, string $identifier = SwitchUserListener::EXIT_VALUE): string
{
if (null === ($request = $this->requestStack->getCurrentRequest())) {
return '';
Expand Down
2 changes: 1 addition & 1 deletion LoginLink/LoginLinkHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct(UrlGeneratorInterface $urlGenerator, UserProviderInt
], $options);
}

public function createLoginLink(UserInterface $user, Request $request = null, int $lifetime = null): LoginLinkDetails
public function createLoginLink(UserInterface $user, ?Request $request = null, ?int $lifetime = null): LoginLinkDetails
{
$expires = time() + ($lifetime ?: $this->options['lifetime']);
$expiresAt = new \DateTimeImmutable('@'.$expires);
Expand Down
Loading

0 comments on commit d1962d0

Please sign in to comment.