Skip to content

Commit 088a4f3

Browse files
lbbyfjaviereguiluz
authored andcommitted
[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`.
1 parent 437b6f8 commit 088a4f3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

security/passwords.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -518,13 +518,13 @@ migration by returning ``true`` in the ``needsRehash()`` method::
518518
namespace App\Security;
519519

520520
// ...
521-
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
521+
use Symfony\Component\PasswordHasher\PasswordHasherInterface;
522522

523-
class CustomPasswordHasher implements UserPasswordHasherInterface
523+
class CustomPasswordHasher implements PasswordHasherInterface
524524
{
525525
// ...
526526

527-
public function needsRehash(string $hashed): bool
527+
public function needsRehash(string $hashedPassword): bool
528528
{
529529
// check whether the current password is hashed using an outdated hasher
530530
$hashIsOutdated = ...;

0 commit comments

Comments
 (0)