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

IntegerQueryCriteria::getInteger()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
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 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