Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 1 |
1 | <?php |
||
25 | public function handle(ResetPassword $command) |
||
26 | { |
||
27 | if ($command->passwordConfirmationIsValid()) { |
||
28 | $user = $command->getUser(); |
||
29 | $updatedUser = clone $user; |
||
30 | $updatedUser->setPassword($command->getPassword()); |
||
31 | $updatedUser->clearPasswordResetToken(); |
||
32 | $repository = $this->userRepositoryCollection->findRepositoryByClassName(get_class($user)); |
||
33 | $repository->update($user, $updatedUser); |
||
34 | |||
35 | return; |
||
36 | } |
||
37 | |||
38 | throw new InvalidPasswordConfirmationException('The password confirmation isn\'t valid'); |
||
39 | } |
||
40 | } |
||
41 |