| Total Complexity | 5 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Coverage | 78.95% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class PasswordResetTokenRepository implements PasswordResetTokenRepositoryInterface { |
||
| 10 | |||
| 11 | private $em; |
||
| 12 | |||
| 13 | 1 | public function __construct(EntityManagerInterface $entityManager) { |
|
| 14 | 1 | $this->em = $entityManager; |
|
| 15 | 1 | } |
|
| 16 | |||
| 17 | 1 | public function persist(PasswordResetToken $passwordResetToken) { |
|
| 18 | 1 | $this->em->persist($passwordResetToken); |
|
| 19 | 1 | $this->em->flush(); |
|
| 20 | 1 | } |
|
| 21 | |||
| 22 | 1 | public function remove(PasswordResetToken $passwordResetToken) { |
|
| 23 | 1 | $this->em->remove($passwordResetToken); |
|
| 24 | 1 | $this->em->flush(); |
|
| 25 | 1 | } |
|
| 26 | |||
| 27 | 1 | public function findOneByUser(User $user): ?PasswordResetToken { |
|
| 28 | 1 | return $this->em->getRepository(PasswordResetToken::class) |
|
| 29 | 1 | ->findOneBy([ |
|
| 30 | 1 | 'user' => $user |
|
| 31 | ]); |
||
| 32 | } |
||
| 33 | |||
| 34 | public function findOneByToken(string $token): ?PasswordResetToken { |
||
| 38 | ]); |
||
| 39 | } |
||
| 40 | } |