ChangePassword
in package
Use case for changing a user's password (requires current password).
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- execute() : void
- Change the user's password.
Properties
$passwordHasher
private
PasswordHasher
$passwordHasher
$repository
private
UserRepositoryInterface
$repository
Methods
__construct()
public
__construct(UserRepositoryInterface $repository[, PasswordHasher|null $passwordHasher = null ]) : mixed
Parameters
- $repository : UserRepositoryInterface
- $passwordHasher : PasswordHasher|null = null
execute()
Change the user's password.
public
execute(User $user, string $currentPassword, string $newPassword) : void
Parameters
- $user : User
-
The user
- $currentPassword : string
-
Current password for verification
- $newPassword : string
-
New password