Skip to content

Commit 6e01dc1

Browse files
committed
minor #20990 [Security] Fix type in upgradePassword (Synxgz)
This PR was squashed before being merged into the 6.4 branch. Discussion ---------- [Security] Fix type in `upgradePassword` Fix the wrong type for the method `upgradePassword` according to `PasswordUpgraderInterface`. It is wrong since the 6.0, the signature has changed from `PasswordAuthenticatedUserInterface|UserInterface` to `PasswordAuthenticatedUserInterface` in `PasswordUpgraderInterface`. Commit: symfony/symfony@30e2c00#diff-b31195679b81d7a86cf868774ef3bf74a79e8e059250db399531b989b4919bdeL17 Prevents PHP Error : ``` Compile Error: Declaration of App\Services\Security\EmailUserProvider::upgradePassword(Symfony\Component\Security\Core\User\UserInterface $user, string $newHashedPassword): void must be compatible with Symfony\Component\Security\Core\User\PasswordUpgraderInterface::upgradePassword(Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface $user, string $newHashedPassword): void ``` Commits ------- 6a90896 [Security] Fix type in `upgradePassword`
2 parents f019e47 + 6a90896 commit 6e01dc1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

security/passwords.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,13 +500,14 @@ the user provider::
500500
namespace App\Security;
501501

502502
// ...
503+
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
503504
use Symfony\Component\Security\Core\User\PasswordUpgraderInterface;
504505

505506
class UserProvider implements UserProviderInterface, PasswordUpgraderInterface
506507
{
507508
// ...
508509

509-
public function upgradePassword(UserInterface $user, string $newHashedPassword): void
510+
public function upgradePassword(PasswordAuthenticatedUserInterface $user, string $newHashedPassword): void
510511
{
511512
// set the new hashed password on the User object
512513
$user->setPassword($newHashedPassword);

0 commit comments

Comments
 (0)