| Total Complexity | 5 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | class ChangeEmailVerificationEmailFactory extends AbstractUserEmailFactory |
||
| 24 | { |
||
| 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 | } |
||
| 42 | |||
| 43 | protected static function getRequiredContextKeys(): ?array |
||
| 47 | ]); |
||
| 48 | } |
||
| 49 | |||
| 50 | protected function getTemplate(): string |
||
| 53 | } |
||
| 54 | } |
||
| 55 |