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

IntegerCriteria   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 31
rs 10
ccs 7
cts 7
cp 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getInteger() 0 4 1
A setInteger() 0 4 1
A shouldBeApplied() 0 4 1
1
<?php
2
3
namespace KGzocha\Searcher\Criteria;
4
5
/**
6
 * @author Krzysztof Gzocha <[email protected]>
7
 */
8
class IntegerCriteria implements CriteriaInterface
9
{
10
    /**
11
     * @var int
12
     */
13
    private $integer;
14
15
    /**
16
     * @return int
17
     */
18 1
    public function getInteger()
19
    {
20 1
        return $this->integer;
21
    }
22
23
    /**
24
     * @param int $integer
25
     */
26 2
    public function setInteger($integer)
27
    {
28 2
        $this->integer = (int) $integer;
29 2
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34 2
    public function shouldBeApplied()
35
    {
36 2
        return $this->integer !== null;
37
    }
38
}
39