UserPasswordHasher
in package
implements
UserPasswordHasherInterface
Hashes passwords based on the user and the PasswordHasherFactory.
Tags
Table of Contents
Interfaces
- UserPasswordHasherInterface
- Interface for the user password hasher service.
Properties
- $hasherFactory : mixed
Methods
- __construct() : mixed
- hashPassword() : string
- Hashes the plain password for the given user.
- isPasswordValid() : bool
- Checks if the plaintext password matches the user's password.
- needsRehash() : bool
- Checks if an encoded password would benefit from rehashing.
Properties
$hasherFactory
private
mixed
$hasherFactory
Methods
__construct()
public
__construct(PasswordHasherFactoryInterface $hasherFactory) : mixed
Parameters
- $hasherFactory : PasswordHasherFactoryInterface
hashPassword()
Hashes the plain password for the given user.
public
hashPassword(PasswordAuthenticatedUserInterface $user, string $plainPassword) : string
Parameters
- $user : PasswordAuthenticatedUserInterface
- $plainPassword : string
Return values
stringisPasswordValid()
Checks if the plaintext password matches the user's password.
public
isPasswordValid(PasswordAuthenticatedUserInterface $user, string $plainPassword) : bool
Parameters
- $user : PasswordAuthenticatedUserInterface
- $plainPassword : string
Return values
boolneedsRehash()
Checks if an encoded password would benefit from rehashing.
public
needsRehash(PasswordAuthenticatedUserInterface $user) : bool