Skip to content

Commit 3cbacef

Browse files
Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
1 parent bba8c98 commit 3cbacef

19 files changed

+25
-25
lines changed

Authentication/AuthenticationTrustResolver.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
class AuthenticationTrustResolver implements AuthenticationTrustResolverInterface
2424
{
25-
public function isAuthenticated(TokenInterface $token = null): bool
25+
public function isAuthenticated(?TokenInterface $token = null): bool
2626
{
2727
return $token && $token->getUser()
2828
// @deprecated since Symfony 5.4, TokenInterface::isAuthenticated() and AnonymousToken no longer exists in 6.0
@@ -32,7 +32,7 @@ public function isAuthenticated(TokenInterface $token = null): bool
3232
/**
3333
* {@inheritdoc}
3434
*/
35-
public function isAnonymous(TokenInterface $token = null/* , $deprecation = true */)
35+
public function isAnonymous(?TokenInterface $token = null/* , $deprecation = true */)
3636
{
3737
if (1 === \func_num_args() || false !== func_get_arg(1)) {
3838
trigger_deprecation('symfony/security-core', '5.4', 'The "%s()" method is deprecated, use "isAuthenticated()" or "isFullFledged()" if you want to check if the request is (fully) authenticated.', __METHOD__);
@@ -44,15 +44,15 @@ public function isAnonymous(TokenInterface $token = null/* , $deprecation = true
4444
/**
4545
* {@inheritdoc}
4646
*/
47-
public function isRememberMe(TokenInterface $token = null)
47+
public function isRememberMe(?TokenInterface $token = null)
4848
{
4949
return $token && $token instanceof RememberMeToken;
5050
}
5151

5252
/**
5353
* {@inheritdoc}
5454
*/
55-
public function isFullFledged(TokenInterface $token = null)
55+
public function isFullFledged(?TokenInterface $token = null)
5656
{
5757
return $token && !$this->isAnonymous($token, false) && !$this->isRememberMe($token);
5858
}

Authentication/AuthenticationTrustResolverInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,20 @@ interface AuthenticationTrustResolverInterface
3232
*
3333
* @deprecated since Symfony 5.4, use !isAuthenticated() instead
3434
*/
35-
public function isAnonymous(TokenInterface $token = null);
35+
public function isAnonymous(?TokenInterface $token = null);
3636

3737
/**
3838
* Resolves whether the passed token implementation is authenticated
3939
* using remember-me capabilities.
4040
*
4141
* @return bool
4242
*/
43-
public function isRememberMe(TokenInterface $token = null);
43+
public function isRememberMe(?TokenInterface $token = null);
4444

4545
/**
4646
* Resolves whether the passed token implementation is fully authenticated.
4747
*
4848
* @return bool
4949
*/
50-
public function isFullFledged(TokenInterface $token = null);
50+
public function isFullFledged(?TokenInterface $token = null);
5151
}

Authentication/Token/Storage/TokenStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function getToken()
4343
/**
4444
* {@inheritdoc}
4545
*/
46-
public function setToken(TokenInterface $token = null)
46+
public function setToken(?TokenInterface $token = null)
4747
{
4848
if ($token) {
4949
// ensure any initializer is called

Authentication/Token/Storage/TokenStorageInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ public function getToken();
3232
*
3333
* @param TokenInterface|null $token A TokenInterface token, or null if no further authentication information should be stored
3434
*/
35-
public function setToken(TokenInterface $token = null);
35+
public function setToken(?TokenInterface $token = null);
3636
}

Authentication/Token/Storage/UsageTrackingTokenStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function getToken(): ?TokenInterface
5050
/**
5151
* {@inheritdoc}
5252
*/
53-
public function setToken(TokenInterface $token = null): void
53+
public function setToken(?TokenInterface $token = null): void
5454
{
5555
$this->storage->setToken($token);
5656

Authorization/ExpressionLanguage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ExpressionLanguage extends BaseExpressionLanguage
3232
/**
3333
* {@inheritdoc}
3434
*/
35-
public function __construct(CacheItemPoolInterface $cache = null, array $providers = [])
35+
public function __construct(?CacheItemPoolInterface $cache = null, array $providers = [])
3636
{
3737
// prepend the default provider to let users override it easily
3838
array_unshift($providers, new ExpressionLanguageProvider());

Authorization/Voter/ExpressionVoter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ExpressionVoter implements CacheableVoterInterface
3131
private $authChecker;
3232
private $roleHierarchy;
3333

34-
public function __construct(ExpressionLanguage $expressionLanguage, AuthenticationTrustResolverInterface $trustResolver, AuthorizationCheckerInterface $authChecker, RoleHierarchyInterface $roleHierarchy = null)
34+
public function __construct(ExpressionLanguage $expressionLanguage, AuthenticationTrustResolverInterface $trustResolver, AuthorizationCheckerInterface $authChecker, ?RoleHierarchyInterface $roleHierarchy = null)
3535
{
3636
$this->expressionLanguage = $expressionLanguage;
3737
$this->trustResolver = $trustResolver;

Encoder/NativePasswordEncoder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ final class NativePasswordEncoder implements PasswordEncoderInterface, SelfSalti
3131
/**
3232
* @param string|null $algo An algorithm supported by password_hash() or null to use the stronger available algorithm
3333
*/
34-
public function __construct(int $opsLimit = null, int $memLimit = null, int $cost = null, string $algo = null)
34+
public function __construct(?int $opsLimit = null, ?int $memLimit = null, ?int $cost = null, ?string $algo = null)
3535
{
3636
$this->hasher = new NativePasswordHasher($opsLimit, $memLimit, $cost, $algo);
3737
}

Encoder/PasswordHasherAdapter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ public function __construct(PasswordEncoderInterface $passwordEncoder)
2929
$this->passwordEncoder = $passwordEncoder;
3030
}
3131

32-
public function hash(string $plainPassword, string $salt = null): string
32+
public function hash(string $plainPassword, ?string $salt = null): string
3333
{
3434
return $this->passwordEncoder->encodePassword($plainPassword, $salt);
3535
}
3636

37-
public function verify(string $hashedPassword, string $plainPassword, string $salt = null): bool
37+
public function verify(string $hashedPassword, string $plainPassword, ?string $salt = null): bool
3838
{
3939
return $this->passwordEncoder->isPasswordValid($hashedPassword, $plainPassword, $salt);
4040
}

Encoder/SodiumPasswordEncoder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ final class SodiumPasswordEncoder implements PasswordEncoderInterface, SelfSalti
2828
{
2929
use LegacyEncoderTrait;
3030

31-
public function __construct(int $opsLimit = null, int $memLimit = null)
31+
public function __construct(?int $opsLimit = null, ?int $memLimit = null)
3232
{
3333
$this->hasher = new SodiumPasswordHasher($opsLimit, $memLimit);
3434
}

0 commit comments

Comments
 (0)