| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | 5 | private function getToken(User $user, string $type, \DateTimeInterface $expires_at = null): ConfirmationToken |
|
| 28 | { |
||
| 29 | 5 | $confirmationToken = new ConfirmationToken($user, $type); |
|
| 30 | |||
| 31 | 5 | if ($expires_at instanceof \DateTimeInterface) { |
|
| 32 | 5 | $confirmationToken->setExpiresAt($expires_at); |
|
| 33 | } |
||
| 34 | |||
| 35 | 5 | $this->entityManager->persist($confirmationToken); |
|
| 36 | 5 | $this->entityManager->flush(); |
|
| 37 | |||
| 38 | 5 | return $confirmationToken; |
|
| 39 | } |
||
| 40 | } |