|
@@ -85,7 +85,7 @@ discard block |
|
|
block discarded – undo |
|
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); |
|
@@ -165,11 +165,11 @@ discard block |
|
|
block discarded – undo |
|
165
|
165
|
if (!empty($params[GoogleMapsRequestFields::LOCATION])) {//-33.8670522,151.1957362 |
|
166
|
166
|
$location = $params[GoogleMapsRequestFields::LOCATION]; |
|
167
|
167
|
if (!$location instanceof Location) { |
|
168
|
|
- throw new InvalidArgumentException(GoogleMapsRequestFields::LOCATION . ' field must be instance of ' . Location::class . ' class'); |
|
|
168
|
+ throw new InvalidArgumentException(GoogleMapsRequestFields::LOCATION.' field must be instance of '.Location::class.' class'); |
|
169
|
169
|
} |
|
170
|
|
- $params[GoogleMapsRequestFields::LOCATION] = (string)$params[GoogleMapsRequestFields::LOCATION]; |
|
|
170
|
+ $params[GoogleMapsRequestFields::LOCATION] = (string) $params[GoogleMapsRequestFields::LOCATION]; |
|
171
|
171
|
} else { |
|
172
|
|
- throw new InvalidArgumentException(GoogleMapsResultFields::LOCATION . ' field is required'); |
|
|
172
|
+ throw new InvalidArgumentException(GoogleMapsResultFields::LOCATION.' field is required'); |
|
173
|
173
|
} |
|
174
|
174
|
|
|
175
|
175
|
if (!empty($params[GoogleMapsRequestFields::RANKBY]) && |
|
@@ -180,20 +180,20 @@ discard block |
|
|
block discarded – undo |
|
180
|
180
|
empty($params[GoogleMapsRequestFields::TYPE])) { |
|
181
|
181
|
// If rankby=distance (described under Optional parameters below) is specified, |
|
182
|
182
|
// then one or more of keyword, name, or type is required. |
|
183
|
|
- throw new InvalidArgumentException('If ' . GoogleMapsRequestFields::RANKBY . ' is set as "' . RankByValues::DISTANCE . '" one or more of ' . GoogleMapsRequestFields::KEYWORD . ', ' . GoogleMapsRequestFields::NAME . ', ' . GoogleMapsRequestFields::TYPE . ' fields are required'); |
|
|
183
|
+ throw new InvalidArgumentException('If '.GoogleMapsRequestFields::RANKBY.' is set as "'.RankByValues::DISTANCE.'" one or more of '.GoogleMapsRequestFields::KEYWORD.', '.GoogleMapsRequestFields::NAME.', '.GoogleMapsRequestFields::TYPE.' fields are required'); |
|
184
|
184
|
} |
|
185
|
185
|
if (!empty($params[GoogleMapsRequestFields::RADIUS])) { |
|
186
|
186
|
// Note that radius must not be included if rankby=distance (described under Optional parameters below) is specified. |
|
187
|
|
- throw new InvalidArgumentException(GoogleMapsRequestFields::RADIUS . ' must not be included if ' . GoogleMapsRequestFields::RANKBY . ' = ' . RankByValues::DISTANCE); |
|
|
187
|
+ throw new InvalidArgumentException(GoogleMapsRequestFields::RADIUS.' must not be included if '.GoogleMapsRequestFields::RANKBY.' = '.RankByValues::DISTANCE); |
|
188
|
188
|
} |
|
189
|
189
|
} elseif (empty($params[GoogleMapsRequestFields::RADIUS])) { |
|
190
|
190
|
// radius — Defines the distance (in meters) within which to return place results. |
|
191
|
|
- throw new InvalidArgumentException(GoogleMapsRequestFields::RADIUS . ' field is required'); |
|
|
191
|
+ throw new InvalidArgumentException(GoogleMapsRequestFields::RADIUS.' field is required'); |
|
192
|
192
|
} |
|
193
|
193
|
|
|
194
|
194
|
if (!empty($params[GoogleMapsRequestFields::RADIUS]) && floatval($params[GoogleMapsRequestFields::RADIUS]) > Config::MAX_PLACE_RADIUS_VALUE) { |
|
195
|
195
|
// The maximum allowed radius is 50 000 meters. |
|
196
|
|
- throw new InvalidArgumentException(GoogleMapsRequestFields::RADIUS . ' must be lower than ' . Config::MAX_PLACE_RADIUS_VALUE); |
|
|
196
|
+ throw new InvalidArgumentException(GoogleMapsRequestFields::RADIUS.' must be lower than '.Config::MAX_PLACE_RADIUS_VALUE); |
|
197
|
197
|
} |
|
198
|
198
|
|
|
199
|
199
|
return $this->makeApiCall($params, PlaceServicesEndpoints::NEARBYSEARCH); |