Skip to content

Commit 5189cdf

Browse files
Merge branch '6.3' into 6.4
* 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
2 parents e001f75 + 5131409 commit 5189cdf

8 files changed

+13
-13
lines changed

Exception/InvalidPasswordException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
class InvalidPasswordException extends \RuntimeException implements ExceptionInterface
1818
{
19-
public function __construct(string $message = 'Invalid password.', int $code = 0, \Throwable $previous = null)
19+
public function __construct(string $message = 'Invalid password.', int $code = 0, ?\Throwable $previous = null)
2020
{
2121
parent::__construct($message, $code, $previous);
2222
}

Hasher/MessageDigestPasswordHasher.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct(string $algorithm = 'sha512', bool $encodeHashAsBase
4848
$this->iterations = $iterations;
4949
}
5050

51-
public function hash(#[\SensitiveParameter] string $plainPassword, string $salt = null): string
51+
public function hash(#[\SensitiveParameter] string $plainPassword, ?string $salt = null): string
5252
{
5353
if ($this->isPasswordTooLong($plainPassword)) {
5454
throw new InvalidPasswordException();
@@ -69,7 +69,7 @@ public function hash(#[\SensitiveParameter] string $plainPassword, string $salt
6969
return $this->encodeHashAsBase64 ? base64_encode($digest) : bin2hex($digest);
7070
}
7171

72-
public function verify(string $hashedPassword, #[\SensitiveParameter] string $plainPassword, string $salt = null): bool
72+
public function verify(string $hashedPassword, #[\SensitiveParameter] string $plainPassword, ?string $salt = null): bool
7373
{
7474
if (\strlen($hashedPassword) !== $this->hashLength || str_contains($hashedPassword, '$')) {
7575
return false;

Hasher/MigratingPasswordHasher.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ public function __construct(PasswordHasherInterface $bestHasher, PasswordHasherI
3333
$this->extraHashers = $extraHashers;
3434
}
3535

36-
public function hash(#[\SensitiveParameter] string $plainPassword, string $salt = null): string
36+
public function hash(#[\SensitiveParameter] string $plainPassword, ?string $salt = null): string
3737
{
3838
return $this->bestHasher->hash($plainPassword, $salt);
3939
}
4040

41-
public function verify(string $hashedPassword, #[\SensitiveParameter] string $plainPassword, string $salt = null): bool
41+
public function verify(string $hashedPassword, #[\SensitiveParameter] string $plainPassword, ?string $salt = null): bool
4242
{
4343
if ($this->bestHasher->verify($hashedPassword, $plainPassword, $salt)) {
4444
return true;

Hasher/NativePasswordHasher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ final class NativePasswordHasher implements PasswordHasherInterface
3131
/**
3232
* @param string|null $algorithm An algorithm supported by password_hash() or null to use the best available algorithm
3333
*/
34-
public function __construct(int $opsLimit = null, int $memLimit = null, int $cost = null, string $algorithm = null)
34+
public function __construct(?int $opsLimit = null, ?int $memLimit = null, ?int $cost = null, ?string $algorithm = null)
3535
{
3636
$cost ??= 13;
3737
$opsLimit ??= max(4, \defined('SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE') ? \SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE : 4);

Hasher/Pbkdf2PasswordHasher.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function __construct(string $algorithm = 'sha512', bool $encodeHashAsBase
5959
$this->iterations = $iterations;
6060
}
6161

62-
public function hash(#[\SensitiveParameter] string $plainPassword, string $salt = null): string
62+
public function hash(#[\SensitiveParameter] string $plainPassword, ?string $salt = null): string
6363
{
6464
if ($this->isPasswordTooLong($plainPassword)) {
6565
throw new InvalidPasswordException();
@@ -74,7 +74,7 @@ public function hash(#[\SensitiveParameter] string $plainPassword, string $salt
7474
return $this->encodeHashAsBase64 ? base64_encode($digest) : bin2hex($digest);
7575
}
7676

77-
public function verify(string $hashedPassword, #[\SensitiveParameter] string $plainPassword, string $salt = null): bool
77+
public function verify(string $hashedPassword, #[\SensitiveParameter] string $plainPassword, ?string $salt = null): bool
7878
{
7979
if (\strlen($hashedPassword) !== $this->encodedLength || str_contains($hashedPassword, '$')) {
8080
return false;

Hasher/PlaintextPasswordHasher.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct(bool $ignorePasswordCase = false)
3535
$this->ignorePasswordCase = $ignorePasswordCase;
3636
}
3737

38-
public function hash(#[\SensitiveParameter] string $plainPassword, string $salt = null): string
38+
public function hash(#[\SensitiveParameter] string $plainPassword, ?string $salt = null): string
3939
{
4040
if ($this->isPasswordTooLong($plainPassword)) {
4141
throw new InvalidPasswordException();
@@ -44,7 +44,7 @@ public function hash(#[\SensitiveParameter] string $plainPassword, string $salt
4444
return $this->mergePasswordAndSalt($plainPassword, $salt);
4545
}
4646

47-
public function verify(string $hashedPassword, #[\SensitiveParameter] string $plainPassword, string $salt = null): bool
47+
public function verify(string $hashedPassword, #[\SensitiveParameter] string $plainPassword, ?string $salt = null): bool
4848
{
4949
if ($this->isPasswordTooLong($plainPassword)) {
5050
return false;

Hasher/SodiumPasswordHasher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final class SodiumPasswordHasher implements PasswordHasherInterface
2929
private int $opsLimit;
3030
private int $memLimit;
3131

32-
public function __construct(int $opsLimit = null, int $memLimit = null)
32+
public function __construct(?int $opsLimit = null, ?int $memLimit = null)
3333
{
3434
if (!self::isSupported()) {
3535
throw new LogicException('Libsodium is not available. You should either install the sodium extension or use a different password hasher.');

LegacyPasswordHasherInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ interface LegacyPasswordHasherInterface extends PasswordHasherInterface
2727
*
2828
* @throws InvalidPasswordException If the plain password is invalid, e.g. excessively long
2929
*/
30-
public function hash(#[\SensitiveParameter] string $plainPassword, string $salt = null): string;
30+
public function hash(#[\SensitiveParameter] string $plainPassword, ?string $salt = null): string;
3131

3232
/**
3333
* Checks that a plain password and a salt match a password hash.
3434
*/
35-
public function verify(string $hashedPassword, #[\SensitiveParameter] string $plainPassword, string $salt = null): bool;
35+
public function verify(string $hashedPassword, #[\SensitiveParameter] string $plainPassword, ?string $salt = null): bool;
3636
}

0 commit comments

Comments
 (0)