Completed
Push — master ( 22cfbb...0f305f )
by Krzysztof
8s
created

CoordinatesCriteria::getLatitude()   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\Criteria;
4
5
/**
6
 * @author Krzysztof Gzocha <[email protected]>
7
 */
8
class CoordinatesCriteria implements CriteriaInterface
9
{
10
    /**
11
     * @var float
12
     */
13
    private $latitude;
14
15
    /**
16
     * @var float
17
     */
18
    private $longitude;
19
20
    /**
21
     * @return float
22
     */
23 1
    public function getLatitude()
24
    {
25 1
        return $this->latitude;
26
    }
27
28
    /**
29
     * @param float $latitude
30
     */
31 1
    public function setLatitude($latitude)
32
    {
33 1
        $this->latitude = (float) $latitude;
34 1
    }
35
36
    /**
37
     * @return float
38
     */
39 1
    public function getLongitude()
40
    {
41 1
        return $this->longitude;
42
    }
43
44
    /**
45
     * @param float $longitude
46
     */
47 1
    public function setLongitude($longitude)
48
    {
49 1
        $this->longitude = (float) $longitude;
50 1
    }
51
52
    /**
53
     * {@inheritdoc}
54
     */
55 2
    public function shouldBeApplied()
56
    {
57 2
        return $this->latitude !== null
58 2
            && $this->longitude !== null;
59
    }
60
}
61