Skip to content

Commit ed19471

Browse files
Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
1 parent 6477c31 commit ed19471

File tree

12 files changed

+15
-15
lines changed

12 files changed

+15
-15
lines changed

DataCollector/SecurityDataCollector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class SecurityDataCollector extends DataCollector implements LateDataCollectorIn
4646
private $hasVarDumper;
4747
private $authenticatorManagerEnabled;
4848

49-
public function __construct(TokenStorageInterface $tokenStorage = null, RoleHierarchyInterface $roleHierarchy = null, LogoutUrlGenerator $logoutUrlGenerator = null, AccessDecisionManagerInterface $accessDecisionManager = null, FirewallMapInterface $firewallMap = null, TraceableFirewallListener $firewall = null, bool $authenticatorManagerEnabled = false)
49+
public function __construct(?TokenStorageInterface $tokenStorage = null, ?RoleHierarchyInterface $roleHierarchy = null, ?LogoutUrlGenerator $logoutUrlGenerator = null, ?AccessDecisionManagerInterface $accessDecisionManager = null, ?FirewallMapInterface $firewallMap = null, ?TraceableFirewallListener $firewall = null, bool $authenticatorManagerEnabled = false)
5050
{
5151
if (!$authenticatorManagerEnabled) {
5252
trigger_deprecation('symfony/security-bundle', '5.4', 'Setting the $authenticatorManagerEnabled argument of "%s" to "false" is deprecated, use the new authenticator system instead.', __METHOD__);
@@ -65,7 +65,7 @@ public function __construct(TokenStorageInterface $tokenStorage = null, RoleHier
6565
/**
6666
* {@inheritdoc}
6767
*/
68-
public function collect(Request $request, Response $response, \Throwable $exception = null)
68+
public function collect(Request $request, Response $response, ?\Throwable $exception = null)
6969
{
7070
if (null === $this->tokenStorage) {
7171
$this->data = [

DependencyInjection/SecurityExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ private function createContextListener(ContainerBuilder $container, string $cont
620620
return $this->contextListeners[$contextKey] = $listenerId;
621621
}
622622

623-
private function createAuthenticationListeners(ContainerBuilder $container, string $id, array $firewall, array &$authenticationProviders, ?string $defaultProvider, array $providerIds, ?string $defaultEntryPoint, string $contextListenerId = null)
623+
private function createAuthenticationListeners(ContainerBuilder $container, string $id, array $firewall, array &$authenticationProviders, ?string $defaultProvider, array $providerIds, ?string $defaultEntryPoint, ?string $contextListenerId = null)
624624
{
625625
$listeners = [];
626626
$hasListeners = false;
@@ -1060,7 +1060,7 @@ private function createExpression(ContainerBuilder $container, string $expressio
10601060
return $this->expressions[$id] = new Reference($id);
10611061
}
10621062

1063-
private function createRequestMatcher(ContainerBuilder $container, string $path = null, string $host = null, int $port = null, array $methods = [], array $ips = null, array $attributes = []): Reference
1063+
private function createRequestMatcher(ContainerBuilder $container, ?string $path = null, ?string $host = null, ?int $port = null, array $methods = [], ?array $ips = null, array $attributes = []): Reference
10641064
{
10651065
if ($methods) {
10661066
$methods = array_map('strtoupper', $methods);

LoginLink/FirewallAwareLoginLinkHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct(FirewallMap $firewallMap, ContainerInterface $loginL
3838
$this->requestStack = $requestStack;
3939
}
4040

41-
public function createLoginLink(UserInterface $user, Request $request = null): LoginLinkDetails
41+
public function createLoginLink(UserInterface $user, ?Request $request = null): LoginLinkDetails
4242
{
4343
return $this->getForFirewall()->createLoginLink($user, $request);
4444
}

Security/FirewallConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final class FirewallConfig
2929
private $authenticators;
3030
private $switchUser;
3131

32-
public function __construct(string $name, string $userChecker, string $requestMatcher = null, bool $securityEnabled = true, bool $stateless = false, string $provider = null, string $context = null, string $entryPoint = null, string $accessDeniedHandler = null, string $accessDeniedUrl = null, array $authenticators = [], array $switchUser = null)
32+
public function __construct(string $name, string $userChecker, ?string $requestMatcher = null, bool $securityEnabled = true, bool $stateless = false, ?string $provider = null, ?string $context = null, ?string $entryPoint = null, ?string $accessDeniedHandler = null, ?string $accessDeniedUrl = null, array $authenticators = [], ?array $switchUser = null)
3333
{
3434
$this->name = $name;
3535
$this->userChecker = $userChecker;

Security/FirewallContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class FirewallContext
3030
/**
3131
* @param iterable<mixed, callable> $listeners
3232
*/
33-
public function __construct(iterable $listeners, ExceptionListener $exceptionListener = null, LogoutListener $logoutListener = null, FirewallConfig $config = null)
33+
public function __construct(iterable $listeners, ?ExceptionListener $exceptionListener = null, ?LogoutListener $logoutListener = null, ?FirewallConfig $config = null)
3434
{
3535
$this->listeners = $listeners;
3636
$this->exceptionListener = $exceptionListener;

Tests/DataCollector/SecurityDataCollectorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public function testCollectCollectsDecisionLogWhenStrategyIsAffirmative()
230230
$voter2 = new DummyVoter();
231231

232232
$decoratedVoter1 = new TraceableVoter($voter1, new class() implements EventDispatcherInterface {
233-
public function dispatch(object $event, string $eventName = null): object
233+
public function dispatch(object $event, ?string $eventName = null): object
234234
{
235235
return new \stdClass();
236236
}
@@ -305,7 +305,7 @@ public function testCollectCollectsDecisionLogWhenStrategyIsUnanimous()
305305
$voter2 = new DummyVoter();
306306

307307
$decoratedVoter1 = new TraceableVoter($voter1, new class() implements EventDispatcherInterface {
308-
public function dispatch(object $event, string $eventName = null): object
308+
public function dispatch(object $event, ?string $eventName = null): object
309309
{
310310
return new \stdClass();
311311
}

Tests/DependencyInjection/Compiler/RegisterEntryPointsPassTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio
9393
], JsonResponse::HTTP_FORBIDDEN);
9494
}
9595

96-
public function start(Request $request, AuthenticationException $authException = null): Response
96+
public function start(Request $request, ?AuthenticationException $authException = null): Response
9797
{
9898
}
9999
}

Tests/Functional/Bundle/AnonymousBundle/AppCustomAuthenticator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function onAuthenticationSuccess(Request $request, TokenInterface $token,
4646
{
4747
}
4848

49-
public function start(Request $request, AuthenticationException $authException = null): Response
49+
public function start(Request $request, ?AuthenticationException $authException = null): Response
5050
{
5151
return new Response($authException->getMessage(), Response::HTTP_UNAUTHORIZED);
5252
}

Tests/Functional/Bundle/FirewallEntryPointBundle/Security/EntryPointStub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class EntryPointStub implements AuthenticationEntryPointInterface
2020
{
2121
public const RESPONSE_TEXT = '2be8e651259189d841a19eecdf37e771e2431741';
2222

23-
public function start(Request $request, AuthenticationException $authException = null): Response
23+
public function start(Request $request, ?AuthenticationException $authException = null): Response
2424
{
2525
return new Response(self::RESPONSE_TEXT);
2626
}

Tests/Functional/Bundle/FormLoginBundle/Controller/LoginController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __construct(ContainerInterface $container)
2929
$this->container = $container;
3030
}
3131

32-
public function loginAction(Request $request, UserInterface $user = null)
32+
public function loginAction(Request $request, ?UserInterface $user = null)
3333
{
3434
// get the login error if there is one
3535
if ($request->attributes->has(Security::AUTHENTICATION_ERROR)) {

0 commit comments

Comments
 (0)