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

IntegerQueryCriteria   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
ccs 7
cts 7
cp 1
rs 10

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\QueryCriteria;
4
5
/**
6
 * @author Krzysztof Gzocha <[email protected]>
7
 * @package KGzocha\Searcher\FilterModel
8
 */
9
class IntegerQueryCriteria implements QueryCriteriaInterface
10
{
11
    /**
12
     * @var int
13
     */
14
    private $integer;
15
16
    /**
17
     * @return int
18
     */
19 1
    public function getInteger()
20
    {
21 1
        return $this->integer;
22
    }
23
24
    /**
25
     * @param int $integer
26
     */
27 2
    public function setInteger($integer)
28
    {
29 2
        $this->integer = (int) $integer;
30 2
    }
31
32
    /**
33
     * @inheritDoc
34
     */
35 2
    public function shouldBeApplied()
36
    {
37 2
        return $this->integer !== null;
38
    }
39
}
40