| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | public function create(AbstractUser $user, array $context = []): ?RawMessage |
||
| 26 | { |
||
| 27 | if (!$this->enabled) { |
||
| 28 | return null; |
||
| 29 | } |
||
| 30 | |||
| 31 | $this->initUser($user); |
||
| 32 | |||
| 33 | $token = $user->getNewEmailVerificationToken(); |
||
| 34 | if (!$token) { |
||
| 35 | throw new InvalidArgumentException('A new email address verification token must be set to send the verification email'); |
||
| 36 | } |
||
| 37 | |||
| 38 | $context['redirect_url'] = $this->getTokenUrl($token, $user->getUsername()); |
||
|
|
|||
| 39 | |||
| 40 | return $this->createEmailMessage($context); |
||
| 41 | } |
||
| 55 |