1 | <?php |
||
11 | class UserResetter |
||
12 | { |
||
13 | /** |
||
14 | * @var UserRepository |
||
15 | */ |
||
16 | private $user; |
||
17 | /** |
||
18 | * @var Authentication |
||
19 | */ |
||
20 | private $auth; |
||
21 | |||
22 | public function __construct(UserRepository $user, Authentication $auth) |
||
27 | |||
28 | /** |
||
29 | * Start the reset password process for given credentials (email) |
||
30 | * @param array $credentials |
||
31 | * @throws UserNotFoundException |
||
32 | */ |
||
33 | public function startReset(array $credentials) |
||
41 | |||
42 | /** |
||
43 | * Finish the reset process |
||
44 | * @param array $data |
||
45 | * @return mixed |
||
46 | * @throws InvalidOrExpiredResetCode |
||
47 | * @throws UserNotFoundException |
||
48 | */ |
||
49 | public function finishReset(array $data) |
||
65 | |||
66 | /** |
||
67 | * @param array $credentials |
||
68 | * @return mixed |
||
69 | * @throws UserNotFoundException |
||
70 | */ |
||
71 | private function findUser(array $credentials) |
||
80 | } |
||
81 |