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

CoordinatesQueryCriteria::getLatitude()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace KGzocha\Searcher\QueryCriteria;
4
5
/**
6
 * @author Krzysztof Gzocha <[email protected]>
7
 * @package KGzocha\Searcher\FilterModel
8
 */
9
class CoordinatesQueryCriteria implements QueryCriteriaInterface
10
{
11
    /**
12
     * @var float
13
     */
14
    private $latitude;
15
16
    /**
17
     * @var float
18
     */
19
    private $longitude;
20
21
    /**
22
     * @return float
23
     */
24
    public function getLatitude()
25
    {
26
        return $this->latitude;
27
    }
28
29
    /**
30
     * @param float $latitude
31
     */
32 1
    public function setLatitude($latitude)
33
    {
34 1
        $this->latitude = (float) $latitude;
35 1
    }
36
37
    /**
38
     * @return float
39
     */
40
    public function getLongitude()
41
    {
42
        return $this->longitude;
43
    }
44
45
    /**
46
     * @param float $longitude
47
     */
48 1
    public function setLongitude($longitude)
49
    {
50 1
        $this->longitude = (float) $longitude;
51 1
    }
52
53
    /**
54
     * @inheritDoc
55
     */
56 2
    public function shouldBeApplied()
57
    {
58 2
        return $this->latitude !== null
59 2
            && $this->longitude !== null;
60
    }
61
}
62