RefreshTokenRepository   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 18
rs 10
c 0
b 0
f 0
ccs 7
cts 7
cp 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A findInvalid() 0 10 2
1
<?php
2
3
namespace Gesdinet\JWTRefreshTokenBundle\Entity;
4
5
use Doctrine\ORM\EntityRepository;
6
7
/**
8
 * RefreshTokenRepository.
9
 *
10
 * This class was generated by the Doctrine ORM. Add your own custom
11
 * repository methods below.
12
 */
13
class RefreshTokenRepository extends EntityRepository
14
{
15 1
    /**
16
     * @param null $datetime
17 1
     *
18
     * @return RefreshToken[]
19 1
     */
20 1
    public function findInvalid($datetime = null)
21 1
    {
22 1
        $datetime = (null === $datetime) ? new \DateTime() : $datetime;
23 1
24
        return $this->createQueryBuilder('u')
25
            ->where('u.valid < :datetime')
26
            ->setParameter(':datetime', $datetime)
27
            ->getQuery()
28
            ->getResult();
29
    }
30
}
31