Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
27 | public function create(AbstractUser $user, array $context = []): ?RawMessage |
||
28 | { |
||
29 | if (!$this->enabled) { |
||
30 | return null; |
||
31 | } |
||
32 | |||
33 | $this->initUser($user); |
||
34 | |||
35 | $token = $user->plainNewPasswordConfirmationToken; |
||
36 | $user->plainNewPasswordConfirmationToken = null; |
||
37 | if (!$token) { |
||
38 | throw new InvalidArgumentException('A new password confirmation token must be set to send the `password reset` email'); |
||
39 | } |
||
40 | |||
41 | $context['redirect_url'] = $this->getTokenUrl($token, $user->getUsername()); |
||
|
|||
42 | |||
43 | return $this->createEmailMessage($context); |
||
44 | } |
||
58 |