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

NumberCriteria   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 32
rs 10

3 Methods

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