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

NumberQueryCriteria::getNumber()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace KGzocha\Searcher\QueryCriteria;
4
5
/**
6
 * @author Krzysztof Gzocha <[email protected]>
7
 * @package KGzocha\Searcher\FilterModel
8
 */
9
class NumberQueryCriteria implements QueryCriteriaInterface
10
{
11
    /**
12
     * @var float
13
     */
14
    private $number;
15
16
    /**
17
     * @return float
18
     */
19
    public function getNumber()
20
    {
21
        return $this->number;
22
    }
23
24
    /**
25
     * @param float $number
26
     */
27
    public function setNumber($number)
28
    {
29
        $this->number = (float) $number;
30
    }
31
32
    /**
33
     * @inheritDoc
34
     */
35
    public function shouldBeApplied()
36
    {
37
        return $this->number !== null
38
            && is_float($this->number);
39
    }
40
}
41