Completed
Push — master ( 7a35bc...7eff79 )
by Krzysztof
05:49 queued 02:58
created

IntegerRangeCriteria::shouldBeApplied()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

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