Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Lines | 12 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
32 | public function handle(SendResetPasswordToken $resendResetPasswordToken) |
||
33 | { |
||
34 | $email = $resendResetPasswordToken->email(); |
||
35 | |||
36 | /** @var ShopUserInterface $user */ |
||
37 | $user = $this->userRepository->findOneByEmail($email); |
||
38 | |||
39 | Assert::notNull($user, sprintf('User with %s email has not been found.', $email)); |
||
40 | Assert::notNull($user->getPasswordResetToken(), sprintf('User with %s email has not verification token defined.', $email)); |
||
41 | |||
42 | $this->sender->send(Emails::EMAIL_RESET_PASSWORD_TOKEN, [$email], ['user' => $user]); |
||
43 | } |
||
44 | } |
||
45 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.