Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
34 | public function verifyNewEmailAddress(string $username, string $email, string $token): void |
||
35 | { |
||
36 | $user = $this->userRepository->findOneByEmailVerificationToken($username, $email, $token); |
||
37 | if (!$user) { |
||
38 | throw new NotFoundHttpException(); |
||
39 | } |
||
40 | |||
41 | $user |
||
42 | ->setEmailAddress($user->getNewEmailAddress()) |
||
43 | ->setNewEmailAddress(null) |
||
44 | ->setEmailAddressVerified(true); |
||
45 | $this->entityManager->flush(); |
||
46 | } |
||
48 |