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

IntegerRangeCriteria   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 52
rs 10
ccs 12
cts 12
cp 1

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getMin() 0 4 1
A setMin() 0 4 1
A getMax() 0 4 1
A setMax() 0 4 1
A shouldBeApplied() 0 4 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