Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 8
0.00% covered (danger)
0.00%
0 / 4
CRAP
0.00% covered (danger)
0.00%
0 / 1
ResetPasswordRequestRepository
0.00% covered (danger)
0.00%
0 / 8
0.00% covered (danger)
0.00%
0 / 4
42
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 save
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
6
 remove
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
6
 createResetPasswordRequest
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace App\Repository;
4
5use App\Entity\ResetPasswordRequest;
6use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
7use Doctrine\Persistence\ManagerRegistry;
8use SymfonyCasts\Bundle\ResetPassword\Model\ResetPasswordRequestInterface;
9use SymfonyCasts\Bundle\ResetPassword\Persistence\Repository\ResetPasswordRequestRepositoryTrait;
10use SymfonyCasts\Bundle\ResetPassword\Persistence\ResetPasswordRequestRepositoryInterface;
11
12/**
13 * @extends ServiceEntityRepository<ResetPasswordRequest>
14 *
15 * @method ResetPasswordRequest|null find($id, $lockMode = null, $lockVersion = null)
16 * @method ResetPasswordRequest|null findOneBy(array $criteria, array $orderBy = null)
17 * @method ResetPasswordRequest[]    findAll()
18 * @method ResetPasswordRequest[]    findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
19 */
20class ResetPasswordRequestRepository extends ServiceEntityRepository implements ResetPasswordRequestRepositoryInterface
21{
22    use ResetPasswordRequestRepositoryTrait;
23
24    public function __construct(ManagerRegistry $registry)
25    {
26        parent::__construct($registry, ResetPasswordRequest::class);
27    }
28
29    public function save(ResetPasswordRequest $entity, bool $flush = false): void
30    {
31        $this->getEntityManager()->persist($entity);
32
33        if ($flush) {
34            $this->getEntityManager()->flush();
35        }
36    }
37
38    public function remove(ResetPasswordRequest $entity, bool $flush = false): void
39    {
40        $this->getEntityManager()->remove($entity);
41
42        if ($flush) {
43            $this->getEntityManager()->flush();
44        }
45    }
46
47    public function createResetPasswordRequest(object $user, \DateTimeInterface $expiresAt, string $selector, string $hashedToken): ResetPasswordRequestInterface
48    {
49        return new ResetPasswordRequest($user, $expiresAt, $selector, $hashedToken);
50    }
51}