Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 11 |
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( |
||
37 | $username, |
||
38 | $email, |
||
39 | $token |
||
40 | ); |
||
41 | if (!$user) { |
||
42 | throw new NotFoundHttpException(); |
||
43 | } |
||
44 | |||
45 | $user |
||
46 | ->setEmailAddress($user->getNewEmailAddress()) |
||
47 | ->setNewEmailAddress(null) |
||
48 | ->setEmailAddressVerified(true); |
||
49 | $this->entityManager->flush(); |
||
50 | } |
||
52 |