| Total Complexity | 4 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | final class WelcomeEmailFactory extends AbstractUserEmailFactory |
||
| 23 | { |
||
| 24 | public const MESSAGE_ID_PREFIX = 'wef'; |
||
| 25 | |||
| 26 | 3 | public function create(AbstractUser $user, array $context = []): ?RawMessage |
|
| 27 | { |
||
| 28 | 3 | if (!$this->enabled) { |
|
| 29 | 1 | return null; |
|
| 30 | } |
||
| 31 | |||
| 32 | 2 | $this->initUser($user); |
|
| 33 | |||
| 34 | 2 | $token = $user->plainNewEmailVerificationToken; |
|
| 35 | 2 | $user->plainNewEmailVerificationToken = null; |
|
| 36 | 2 | if ($token) { |
|
| 37 | 1 | $context['redirect_url'] = $this->getTokenUrl($token, $user->getUsername()); |
|
|
|
|||
| 38 | } |
||
| 39 | |||
| 40 | 2 | return $this->createEmailMessage($context); |
|
| 41 | } |
||
| 42 | |||
| 43 | 2 | protected function getTemplate(): string |
|
| 46 | } |
||
| 47 | } |
||
| 48 |