@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | } |
86 | 86 | |
87 | 87 | if (empty($params[GoogleMapsRequestFields::INPUT])) { |
88 | - throw new InvalidArgumentException(GoogleMapsRequestFields::INPUT . " field is required"); |
|
88 | + throw new InvalidArgumentException(GoogleMapsRequestFields::INPUT." field is required"); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | return $this->makeApiCall($params, PlaceServicesEndpoints::FINDPLACEFROMTEXT); |
@@ -179,11 +179,11 @@ discard block |
||
179 | 179 | if (!empty($params[GoogleMapsRequestFields::LOCATION])) {//-33.8670522,151.1957362 |
180 | 180 | $location = $params[GoogleMapsRequestFields::LOCATION]; |
181 | 181 | if (!$location instanceof Location) { |
182 | - throw new InvalidArgumentException(GoogleMapsRequestFields::LOCATION . ' field must be instance of ' . Location::class . ' class'); |
|
182 | + throw new InvalidArgumentException(GoogleMapsRequestFields::LOCATION.' field must be instance of '.Location::class.' class'); |
|
183 | 183 | } |
184 | - $params[GoogleMapsRequestFields::LOCATION] = (string)$params[GoogleMapsRequestFields::LOCATION]; |
|
184 | + $params[GoogleMapsRequestFields::LOCATION] = (string) $params[GoogleMapsRequestFields::LOCATION]; |
|
185 | 185 | } else { |
186 | - throw new InvalidArgumentException(GoogleMapsResultFields::LOCATION . ' field is required'); |
|
186 | + throw new InvalidArgumentException(GoogleMapsResultFields::LOCATION.' field is required'); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | if (!empty($params[GoogleMapsRequestFields::RANKBY]) && |
@@ -194,20 +194,20 @@ discard block |
||
194 | 194 | empty($params[GoogleMapsRequestFields::TYPE])) { |
195 | 195 | // If rankby=distance (described under Optional parameters below) is specified, |
196 | 196 | // then one or more of keyword, name, or type is required. |
197 | - throw new InvalidArgumentException('If ' . GoogleMapsRequestFields::RANKBY . ' is set as "' . RankByValues::DISTANCE . '" one or more of ' . GoogleMapsRequestFields::KEYWORD . ', ' . GoogleMapsRequestFields::NAME . ', ' . GoogleMapsRequestFields::TYPE . ' fields are required'); |
|
197 | + throw new InvalidArgumentException('If '.GoogleMapsRequestFields::RANKBY.' is set as "'.RankByValues::DISTANCE.'" one or more of '.GoogleMapsRequestFields::KEYWORD.', '.GoogleMapsRequestFields::NAME.', '.GoogleMapsRequestFields::TYPE.' fields are required'); |
|
198 | 198 | } |
199 | 199 | if (!empty($params[GoogleMapsRequestFields::RADIUS])) { |
200 | 200 | // Note that radius must not be included if rankby=distance (described under Optional parameters below) is specified. |
201 | - throw new InvalidArgumentException(GoogleMapsRequestFields::RADIUS . ' must not be included if ' . GoogleMapsRequestFields::RANKBY . ' = ' . RankByValues::DISTANCE); |
|
201 | + throw new InvalidArgumentException(GoogleMapsRequestFields::RADIUS.' must not be included if '.GoogleMapsRequestFields::RANKBY.' = '.RankByValues::DISTANCE); |
|
202 | 202 | } |
203 | 203 | } elseif (empty($params[GoogleMapsRequestFields::RADIUS])) { |
204 | 204 | // radius — Defines the distance (in meters) within which to return place results. |
205 | - throw new InvalidArgumentException(GoogleMapsRequestFields::RADIUS . ' field is required'); |
|
205 | + throw new InvalidArgumentException(GoogleMapsRequestFields::RADIUS.' field is required'); |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | if (!empty($params[GoogleMapsRequestFields::RADIUS]) && floatval($params[GoogleMapsRequestFields::RADIUS]) > Util::MAX_PLACE_RADIUS_VALUE) { |
209 | 209 | // The maximum allowed radius is 50 000 meters. |
210 | - throw new InvalidArgumentException(GoogleMapsRequestFields::RADIUS . ' must be lower than ' . Util::MAX_PLACE_RADIUS_VALUE); |
|
210 | + throw new InvalidArgumentException(GoogleMapsRequestFields::RADIUS.' must be lower than '.Util::MAX_PLACE_RADIUS_VALUE); |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | return $this->makeApiCall($params, PlaceServicesEndpoints::NEARBYSEARCH); |
@@ -73,13 +73,13 @@ |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | if (is_array($locations)) { |
76 | - $locations = implode('|', array_map(function ($item) { |
|
76 | + $locations = implode('|', array_map(function($item) { |
|
77 | 77 | |
78 | - return (string)$item; |
|
78 | + return (string) $item; |
|
79 | 79 | }, $locations)); |
80 | 80 | } |
81 | 81 | |
82 | - return (string)$locations; |
|
82 | + return (string) $locations; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -143,9 +143,9 @@ |
||
143 | 143 | } |
144 | 144 | |
145 | 145 | $request_endpoint = $this->request->getEndpoint(); |
146 | - array_push($url_chunks, $this->api_url . $service_endpoint); |
|
146 | + array_push($url_chunks, $this->api_url.$service_endpoint); |
|
147 | 147 | |
148 | - if($request_endpoint) { |
|
148 | + if ($request_endpoint) { |
|
149 | 149 | array_push($url_chunks, $request_endpoint); |
150 | 150 | } |
151 | 151 |
@@ -106,7 +106,7 @@ |
||
106 | 106 | public function createRequest(array $params, ?string $endpoint = null): GoogleMapsRequest |
107 | 107 | { |
108 | 108 | |
109 | - $this->request = new GoogleMapsRequest($params, $endpoint);; |
|
109 | + $this->request = new GoogleMapsRequest($params, $endpoint); ; |
|
110 | 110 | |
111 | 111 | return $this->request; |
112 | 112 | } |
@@ -127,7 +127,7 @@ |
||
127 | 127 | $error_message = $array_response[GoogleMapsResponseFields::ERROR_MESSAGE]; |
128 | 128 | $this->setErrorMessage($error_message); |
129 | 129 | } elseif (!empty($array_response[GoogleMapsResponseFields::STATUS])) { |
130 | - $error_message .= ': ' . $array_response[GoogleMapsResponseFields::STATUS]; |
|
130 | + $error_message .= ': '.$array_response[GoogleMapsResponseFields::STATUS]; |
|
131 | 131 | $this->setErrorMessage($error_message); |
132 | 132 | } |
133 | 133 | throw new RequestException($error_message); |
@@ -20,7 +20,7 @@ |
||
20 | 20 | /** |
21 | 21 | * @var string |
22 | 22 | */ |
23 | - const TEXTQUERY = "textquery"; |
|
23 | + const TEXTQUERY = "textquery"; |
|
24 | 24 | |
25 | 25 | /** |
26 | 26 | * @var string |