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

IntegerCriteria::setInteger()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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