Completed
Pull Request — master (#15)
by Wachter
15:35 queued 05:39
created

TaskRepository::findEndBefore()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
ccs 6
cts 6
cp 1
cc 1
eloc 5
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Task\TaskBundle\Entity;
4
5
use Doctrine\ORM\EntityRepository;
6
7
class TaskRepository extends EntityRepository
8
{
9 6
    public function findEndBefore(\DateTime $dateTime)
10
    {
11 6
        $this->createQueryBuilder('t')
12 6
            ->where('t.lastExecution IS NOT NULL OR t.lastExecution > :dateTime')
13 6
            ->setParameter('dateTime', $dateTime)
14 6
            ->getQuery()->getResult();
15 6
    }
16
}
17