From 088a4f3a50785d04f56e1dc31f8416df376e4934 Mon Sep 17 00:00:00 2001 From: Franklin LIA <46316603+lbbyf@users.noreply.github.com> Date: Mon, 8 Jan 2024 16:22:13 +0100 Subject: [PATCH] [DOC][SECURITY] Update passwords.rst The signature of the needsRehash method of the `SymfonyComponentPasswordHasher\Hasher\UserPasswordHasherInterface` interface is `public function needsRehash(PasswordAuthenticatedUserInterface $user): bool;`. If we use the method `public function needsRehash(string $hashedPassword): bool;`, then the interface should be `Symfony\Component\PasswordHasher\PasswordHasherInterface`. --- security/passwords.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/security/passwords.rst b/security/passwords.rst index 6807785a29f..581c7b85870 100644 --- a/security/passwords.rst +++ b/security/passwords.rst @@ -518,13 +518,13 @@ migration by returning ``true`` in the ``needsRehash()`` method:: namespace App\Security; // ... - use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface; + use Symfony\Component\PasswordHasher\PasswordHasherInterface; - class CustomPasswordHasher implements UserPasswordHasherInterface + class CustomPasswordHasher implements PasswordHasherInterface { // ... - public function needsRehash(string $hashed): bool + public function needsRehash(string $hashedPassword): bool { // check whether the current password is hashed using an outdated hasher $hashIsOutdated = ...;