| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 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->plainEmailAddressVerifyToken; |
||
| 36 | $user->plainEmailAddressVerifyToken = null; |
||
| 37 | if (!$token) { |
||
| 38 | throw new InvalidArgumentException('An `email verify token` must be set to send the verification email'); |
||
| 39 | } |
||
| 40 | |||
| 41 | $context['redirect_url'] = $this->getTokenUrl($token, $user->getUsername()); |
||
|
|
|||
| 42 | |||
| 43 | return $this->createEmailMessage($context); |
||
| 44 | } |
||
| 58 |