| Conditions | 3 |
| Paths | 3 |
| Total Lines | 22 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace Anomaly\UsersModule\User\Password; |
||
| 27 | public function handle( |
||
| 28 | ForgotPasswordFormBuilder $builder, |
||
| 29 | UserRepositoryInterface $users, |
||
| 30 | UserPassword $password, |
||
| 31 | MessageBag $messages, |
||
| 32 | Repository $config |
||
| 33 | ) { |
||
| 34 | if ($builder->hasFormErrors()) { |
||
| 35 | return; |
||
| 36 | } |
||
| 37 | |||
| 38 | $user = $users->findByEmail($builder->getFormValue('email')); |
||
| 39 | |||
| 40 | if ($path = $builder->getFormOption('reset_path')) { |
||
| 41 | $config->set('anomaly.module.users::paths.reset', $path); |
||
| 42 | } |
||
| 43 | |||
| 44 | $password->forgot($user); |
||
| 45 | $password->send($user, $builder->getFormOption('reset_redirect')); |
||
| 46 | |||
| 47 | $messages->success('anomaly.module.users::message.confirm_reset_password'); |
||
| 48 | } |
||
| 49 | } |
||
| 50 |