TextSearchQuery::getLocation()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Arthem\GoogleApi\Domain\Place\Query\Search;
4
5
use Arthem\GoogleApi\Domain\Place\VO\Location;
6
use Arthem\GoogleApi\Domain\Place\VO\Query;
7
use Arthem\GoogleApi\Domain\Place\VO\Radius;
8
9
class TextSearchQuery
10
{
11
    /**
12
     * @var Query
13
     */
14
    private $query;
15
16
    /**
17
     * @var Location
18
     */
19
    private $location;
20
21
    /**
22
     * @var Radius
23
     */
24
    private $radius;
25
26
    /**
27
     * @param string         $query
28
     * @param float|null     $latitude
29
     * @param float|null     $longitude
30
     * @param int|float|null $radius
31
     */
32
    public function __construct($query, $latitude = null, $longitude = null, $radius = null)
33
    {
34
        $this->query = new Query($query);
35
36
        if (null !== $latitude) {
37
            $this->location = new Location($latitude, $longitude);
38
        }
39
40
        if (null !== $radius) {
41
            $this->radius = new Radius($radius);
42
        }
43
    }
44
45
    /**
46
     * @return Query
47
     */
48
    public function getQuery()
49
    {
50
        return $this->query;
51
    }
52
53
    /**
54
     * @return Location|null
55
     */
56
    public function getLocation()
57
    {
58
        return $this->location;
59
    }
60
61
    /**
62
     * @return Radius|null
63
     */
64
    public function getRadius()
65
    {
66
        return $this->radius;
67
    }
68
}
69