1 | <?php |
||
28 | class ChangeUserPasswordHandler |
||
29 | { |
||
30 | /** |
||
31 | * The user password encoder. |
||
32 | * |
||
33 | * @var UserPasswordEncoder |
||
34 | */ |
||
35 | private $encoder; |
||
36 | |||
37 | /** |
||
38 | * The user repository. |
||
39 | * |
||
40 | * @var UserRepository |
||
41 | */ |
||
42 | private $repository; |
||
43 | |||
44 | /** |
||
45 | * Constructor. |
||
46 | * |
||
47 | * @param UserRepository $aRepository The user repository |
||
48 | * @param UserPasswordEncoder $anEncoder The password encoder |
||
49 | */ |
||
50 | public function __construct(UserRepository $aRepository, UserPasswordEncoder $anEncoder) |
||
55 | |||
56 | /** |
||
57 | * Handles the given command. |
||
58 | * |
||
59 | * @param ChangeUserPasswordCommand $aCommand The command |
||
60 | * |
||
61 | * @throws UserDoesNotExistException when the user does not exist |
||
62 | * @throws UserPasswordInvalidException when the user password is invalid |
||
63 | */ |
||
64 | public function __invoke(ChangeUserPasswordCommand $aCommand) |
||
77 | } |
||
78 |