Skip to content

Commit 3a60c09

Browse files
Merge branch '5.2' into 5.3
* 5.2: CS fix CS fix CS fixes Bump Symfony version to 5.2.12 Update VERSION for 5.2.11 Update CHANGELOG for 5.2.11 Bump Symfony version to 4.4.27 Update VERSION for 4.4.26 Update CONTRIBUTORS for 4.4.26 Update CHANGELOG for 4.4.26
2 parents 4809633 + 450fa2c commit 3a60c09

File tree

9 files changed

+16
-19
lines changed

9 files changed

+16
-19
lines changed

Authentication/Token/AbstractToken.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function getRoleNames(): array
5353
*/
5454
public function getUsername(/* $legacy = true */)
5555
{
56-
if (1 === func_num_args() && false === func_get_arg(0)) {
56+
if (1 === \func_num_args() && false === func_get_arg(0)) {
5757
return null;
5858
}
5959

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
}

Signature/SignatureHasher.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212
namespace Symfony\Component\Security\Core\Signature;
1313

1414
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
15-
use Symfony\Component\Security\Core\User\UserInterface;
1615
use Symfony\Component\Security\Core\Signature\Exception\ExpiredSignatureException;
1716
use Symfony\Component\Security\Core\Signature\Exception\InvalidSignatureException;
18-
use Symfony\Component\Security\Core\Signature\ExpiredSignatureStorage;
17+
use Symfony\Component\Security\Core\User\UserInterface;
1918

2019
/**
2120
* Creates and validates secure hashes used in login links and remember-me cookies.
@@ -36,7 +35,7 @@ class SignatureHasher
3635
* @param ExpiredSignatureStorage|null $expiredSignaturesStorage if provided, secures a sequence of hashes that are expired
3736
* @param int|null $maxUses used together with $expiredSignatureStorage to allow a maximum usage of a hash
3837
*/
39-
public function __construct(PropertyAccessorInterface $propertyAccessor, array $signatureProperties, string $secret, ?ExpiredSignatureStorage $expiredSignaturesStorage = null, ?int $maxUses = null)
38+
public function __construct(PropertyAccessorInterface $propertyAccessor, array $signatureProperties, string $secret, ExpiredSignatureStorage $expiredSignaturesStorage = null, int $maxUses = null)
4039
{
4140
$this->propertyAccessor = $propertyAccessor;
4241
$this->signatureProperties = $signatureProperties;

Tests/Authentication/Provider/DaoAuthenticationProviderTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ public function eraseCredentials()
385385
interface PasswordUpgraderProvider extends UserProviderInterface, PasswordUpgraderInterface
386386
{
387387
public function upgradePassword(UserInterface $user, string $newHashedPassword): void;
388+
388389
public function loadUserByIdentifier(string $identifier): UserInterface;
389390
}
390391

Tests/Authentication/Provider/PreAuthenticatedAuthenticationProviderTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
use Symfony\Component\Security\Core\User\InMemoryUserProvider;
2222
use Symfony\Component\Security\Core\User\UserCheckerInterface;
2323
use Symfony\Component\Security\Core\User\UserInterface;
24-
use Symfony\Component\Security\Core\User\UserProviderInterface;
2524

2625
/**
2726
* @group legacy

Tests/Authentication/Token/AbstractTokenTest.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,27 @@ public function testLegacyGetUsername()
3333
$token->setUser(new TestUser('fabien'));
3434
$this->assertEquals('fabien', $token->getUsername());
3535

36-
$legacyUser = new class implements UserInterface {
36+
$legacyUser = new class() implements UserInterface {
3737
public function getUsername()
3838
{
3939
return 'fabien';
4040
}
4141

4242
public function getRoles()
43-
{}
43+
{
44+
}
4445

4546
public function getPassword()
46-
{}
47+
{
48+
}
4749

4850
public function getSalt()
49-
{}
51+
{
52+
}
5053

5154
public function eraseCredentials()
52-
{}
55+
{
56+
}
5357
};
5458
$token->setUser($legacyUser);
5559
$this->assertEquals('fabien', $token->getUsername());

Tests/User/ChainUserProviderTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
2121
use Symfony\Component\Security\Core\User\PasswordUpgraderInterface;
2222
use Symfony\Component\Security\Core\User\UserInterface;
23-
use Symfony\Component\Security\Core\User\UserProviderInterface;
2423

2524
class ChainUserProviderTest extends TestCase
2625
{

User/ChainUserProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function loadUserByIdentifier(string $userIdentifier): UserInterface
6262
try {
6363
// @deprecated since 5.3, change to $provider->loadUserByIdentifier() in 6.0
6464
if (!method_exists($provider, 'loadUserByIdentifier')) {
65-
trigger_deprecation('symfony/security-core', '5.3', 'Not implementing method "loadUserByIdentifier()" in user provider "%s" is deprecated. This method will replace "loadUserByUsername()" in Symfony 6.0.', \get_debug_type($provider));
65+
trigger_deprecation('symfony/security-core', '5.3', 'Not implementing method "loadUserByIdentifier()" in user provider "%s" is deprecated. This method will replace "loadUserByUsername()" in Symfony 6.0.', get_debug_type($provider));
6666

6767
return $provider->loadUserByUsername($userIdentifier);
6868
}

User/UserChecker.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111

1212
namespace Symfony\Component\Security\Core\User;
1313

14-
use Symfony\Component\Security\Core\Exception\AccountExpiredException;
15-
use Symfony\Component\Security\Core\Exception\CredentialsExpiredException;
16-
use Symfony\Component\Security\Core\Exception\DisabledException;
17-
use Symfony\Component\Security\Core\Exception\LockedException;
18-
1914
trigger_deprecation('symfony/security-core', '5.3', 'The "%s" class is deprecated, use "%s" instead.', UserChecker::class, InMemoryUserChecker::class);
2015

2116
class_exists(InMemoryUserChecker::class);

0 commit comments

Comments
 (0)