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