1 | <?php |
||
19 | abstract class AbstractPlaceAutocompleteRequest implements PlaceAutocompleteRequestInterface |
||
20 | { |
||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | private $input; |
||
25 | |||
26 | /** |
||
27 | * @var int|null |
||
28 | */ |
||
29 | private $offset; |
||
30 | |||
31 | /** |
||
32 | * @var Coordinate|null |
||
33 | */ |
||
34 | private $location; |
||
35 | |||
36 | /** |
||
37 | * @var float|null |
||
38 | */ |
||
39 | private $radius; |
||
40 | |||
41 | /** |
||
42 | * @var string|null |
||
43 | */ |
||
44 | private $language; |
||
45 | |||
46 | /** |
||
47 | * @param string $input |
||
48 | */ |
||
49 | 208 | public function __construct($input) |
|
53 | |||
54 | /** |
||
55 | * @return string |
||
56 | */ |
||
57 | 16 | public function getInput() |
|
61 | |||
62 | /** |
||
63 | * @param string $input |
||
64 | */ |
||
65 | 208 | public function setInput($input) |
|
69 | |||
70 | /** |
||
71 | * @return bool |
||
72 | */ |
||
73 | 148 | public function hasOffset() |
|
77 | |||
78 | /** |
||
79 | * @return int|null |
||
80 | */ |
||
81 | 16 | public function getOffset() |
|
85 | |||
86 | /** |
||
87 | * @param int|null $offset |
||
88 | */ |
||
89 | 24 | public function setOffset($offset) |
|
93 | |||
94 | /** |
||
95 | * @return bool |
||
96 | */ |
||
97 | 148 | public function hasLocation() |
|
101 | |||
102 | /** |
||
103 | * @return Coordinate|null |
||
104 | */ |
||
105 | 16 | public function getLocation() |
|
109 | |||
110 | /** |
||
111 | * @param Coordinate|null $location |
||
112 | */ |
||
113 | 40 | public function setLocation(Coordinate $location = null) |
|
117 | |||
118 | /** |
||
119 | * @return bool |
||
120 | */ |
||
121 | 148 | public function hasRadius() |
|
125 | |||
126 | /** |
||
127 | * @return float|null |
||
128 | */ |
||
129 | 16 | public function getRadius() |
|
133 | |||
134 | /** |
||
135 | * @param float|null $radius |
||
136 | */ |
||
137 | 24 | public function setRadius($radius) |
|
141 | |||
142 | /** |
||
143 | * @return bool |
||
144 | */ |
||
145 | 148 | public function hasLanguage() |
|
149 | |||
150 | /** |
||
151 | * @return string|null |
||
152 | */ |
||
153 | 16 | public function getLanguage() |
|
157 | |||
158 | /** |
||
159 | * @param string|null $language |
||
160 | */ |
||
161 | 24 | public function setLanguage($language) |
|
165 | |||
166 | /** |
||
167 | * {@inheritdoc} |
||
168 | */ |
||
169 | 132 | public function buildQuery() |
|
191 | |||
192 | /** |
||
193 | * @param Coordinate $coordinate |
||
194 | * |
||
195 | * @return string |
||
196 | */ |
||
197 | 36 | private function buildCoordinate(Coordinate $coordinate) |
|
201 | } |
||
202 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: