Failed Conditions
Push — master ( bc79fb...9e41f7 )
by Denis
02:47
created

Lt   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

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