Between   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 9
ccs 5
cts 5
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getExpr() 0 7 1
1
<?php declare(strict_types=1);
2
3
namespace Artprima\QueryFilterBundle\Query\Condition;
4
5
use Artprima\QueryFilterBundle\Query\Filter;
6
use Doctrine\ORM\QueryBuilder;
7
8
/**
9
 * Class Between
10
 *
11
 * @author Denis Voytyuk <[email protected]>
12
 *
13
 * @package Artprima\QueryFilterBundle\Query\Condition
14
 */
15
class Between implements ConditionInterface
16
{
17 1
    public function getExpr(QueryBuilder $qb, int $index, Filter $filter)
18
    {
19 1
        $expr = $qb->expr()->between($filter->getField(), ':x'.$index, ':y'.$index);
20 1
        $qb->setParameter('x'.$index, $filter->getX() ?? '');
21 1
        $qb->setParameter('y'.$index, $filter->getY() ?? '');
22
23 1
        return $expr;
24
    }
25
}