1 | <?php namespace Modules\User\Services; |
||
9 | class UserResetter |
||
10 | { |
||
11 | /** |
||
12 | * @var UserRepository |
||
13 | */ |
||
14 | private $user; |
||
15 | /** |
||
16 | * @var Authentication |
||
17 | */ |
||
18 | private $auth; |
||
19 | |||
20 | public function __construct(UserRepository $user, Authentication $auth) |
||
25 | |||
26 | /** |
||
27 | * Start the reset password process for given credentials (email) |
||
28 | * @param array $credentials |
||
29 | * @throws UserNotFoundException |
||
30 | */ |
||
31 | public function startReset(array $credentials) |
||
39 | |||
40 | /** |
||
41 | * Finish the reset process |
||
42 | * @param array $data |
||
43 | * @return mixed |
||
44 | * @throws InvalidOrExpiredResetCode |
||
45 | * @throws UserNotFoundException |
||
46 | */ |
||
47 | public function finishReset(array $data) |
||
63 | |||
64 | /** |
||
65 | * @param array $credentials |
||
66 | * @return mixed |
||
67 | * @throws UserNotFoundException |
||
68 | */ |
||
69 | private function findUser(array $credentials) |
||
78 | } |
||
79 |