Completed
Pull Request — master (#46)
by Daniel
03:48
created

IntegerRangeQueryCriteria::setMax()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace KGzocha\Searcher\QueryCriteria;
4
5
/**
6
 * @author Krzysztof Gzocha <[email protected]>
7
 * @package KGzocha\Searcher\FilterModel
8
 */
9
class IntegerRangeQueryCriteria implements QueryCriteriaInterface
10
{
11
    /**
12
     * @var int
13
     */
14
    private $min;
15
16
    /**
17
     * @var int
18
     */
19
    private $max;
20
21
    /**
22
     * @return int
23
     */
24 1
    public function getMin()
25
    {
26 1
        return $this->min;
27
    }
28
29
    /**
30
     * @param int $min
31
     */
32 2
    public function setMin($min)
33
    {
34 2
        $this->min = (int) $min;
35 2
    }
36
37
    /**
38
     * @return int
39
     */
40 1
    public function getMax()
41
    {
42 1
        return $this->max;
43
    }
44
45
    /**
46
     * @param int $max
47
     */
48 2
    public function setMax($max)
49
    {
50 2
        $this->max = (int) $max;
51 2
    }
52
53
    /**
54
     * @inheritDoc
55
     */
56 2
    public function shouldBeApplied()
57
    {
58 2
        return $this->min !== null && $this->max !== null;
59
    }
60
}
61