@@ -72,15 +72,15 @@ discard block |
||
| 72 | 72 | 'connection_timeout' => 5, |
| 73 | 73 | ]); |
| 74 | 74 | } |
| 75 | - else if($http_client instanceof Client) |
|
| 75 | + else if ($http_client instanceof Client) |
|
| 76 | 76 | { |
| 77 | 77 | $application_url_client = $http_client->getConfig('base_uri'); |
| 78 | 78 | |
| 79 | - if(!isset($application_url_client)) |
|
| 79 | + if (!isset($application_url_client)) |
|
| 80 | 80 | { |
| 81 | 81 | $http_client->setDefaultOption('base_uri', $application_url); |
| 82 | 82 | } |
| 83 | - else if($application_url_client != $application_url) |
|
| 83 | + else if ($application_url_client != $application_url) |
|
| 84 | 84 | { |
| 85 | 85 | throw new InvalidParameterException("http_client parameter has a differente url to application_url parameter"); |
| 86 | 86 | } |
@@ -90,8 +90,8 @@ discard block |
||
| 90 | 90 | throw new InvalidParameterException("http_client parameter must be a GuzzleHttp\Client object or empty"); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - $this->application_url = $application_url; |
|
| 94 | - $this->http_client = $http_client; |
|
| 93 | + $this->application_url = $application_url; |
|
| 94 | + $this->http_client = $http_client; |
|
| 95 | 95 | |
| 96 | 96 | //Create base |
| 97 | 97 | $this->baseSearch = new Search(); |
@@ -131,12 +131,12 @@ discard block |
||
| 131 | 131 | private function decodeResponse($format, Request $request, Response $response) |
| 132 | 132 | { |
| 133 | 133 | |
| 134 | - if($format == 'json') |
|
| 134 | + if ($format == 'json') |
|
| 135 | 135 | { |
| 136 | 136 | return json_decode($response->getBody(), true); |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | - if($format == 'xml') |
|
| 139 | + if ($format == 'xml') |
|
| 140 | 140 | { |
| 141 | 141 | return new \SimpleXMLElement($response->getBody()); |
| 142 | 142 | } |
@@ -71,21 +71,18 @@ |
||
| 71 | 71 | 'timeout' => 30, |
| 72 | 72 | 'connection_timeout' => 5, |
| 73 | 73 | ]); |
| 74 | - } |
|
| 75 | - else if($http_client instanceof Client) |
|
| 74 | + } else if($http_client instanceof Client) |
|
| 76 | 75 | { |
| 77 | 76 | $application_url_client = $http_client->getConfig('base_uri'); |
| 78 | 77 | |
| 79 | 78 | if(!isset($application_url_client)) |
| 80 | 79 | { |
| 81 | 80 | $http_client->setDefaultOption('base_uri', $application_url); |
| 82 | - } |
|
| 83 | - else if($application_url_client != $application_url) |
|
| 81 | + } else if($application_url_client != $application_url) |
|
| 84 | 82 | { |
| 85 | 83 | throw new InvalidParameterException("http_client parameter has a differente url to application_url parameter"); |
| 86 | 84 | } |
| 87 | - } |
|
| 88 | - else |
|
| 85 | + } else |
|
| 89 | 86 | { |
| 90 | 87 | throw new InvalidParameterException("http_client parameter must be a GuzzleHttp\Client object or empty"); |
| 91 | 88 | } |
@@ -20,9 +20,9 @@ discard block |
||
| 20 | 20 | use QueryTrait; |
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | - * Output format accepted |
|
| 24 | - * @var array |
|
| 25 | - */ |
|
| 23 | + * Output format accepted |
|
| 24 | + * @var array |
|
| 25 | + */ |
|
| 26 | 26 | public $accepteFormat = ['html', 'xml', 'json', 'jsonv2']; |
| 27 | 27 | |
| 28 | 28 | /** |
@@ -246,12 +246,12 @@ discard block |
||
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | /** |
| 249 | - * Include a breakdown of the address into elements. |
|
| 250 | - * |
|
| 251 | - * @param boolean $details |
|
| 252 | - * |
|
| 253 | - * @return maxh\Nominatim\Search |
|
| 254 | - */ |
|
| 249 | + * Include a breakdown of the address into elements. |
|
| 250 | + * |
|
| 251 | + * @param boolean $details |
|
| 252 | + * |
|
| 253 | + * @return maxh\Nominatim\Search |
|
| 254 | + */ |
|
| 255 | 255 | public function addressDetails($details = true) |
| 256 | 256 | { |
| 257 | 257 | $this->query['addressdetails'] = $details ? "1" : "0"; |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public function __construct(array $query = []) |
| 39 | 39 | { |
| 40 | - if(!isset($query['format'])) |
|
| 40 | + if (!isset($query['format'])) |
|
| 41 | 41 | { |
| 42 | 42 | //Default format |
| 43 | 43 | $query['format'] = 'json'; |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | { |
| 64 | 64 | $format = strtolower($format); |
| 65 | 65 | |
| 66 | - if(in_array($format, $this->accepteFormat)) |
|
| 66 | + if (in_array($format, $this->accepteFormat)) |
|
| 67 | 67 | { |
| 68 | 68 | $this->query['format'] = $format; |
| 69 | 69 | $this->setFormat($format); |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | { |
| 270 | 270 | $args = func_get_args(); |
| 271 | 271 | |
| 272 | - if(count($args) > 0) |
|
| 272 | + if (count($args) > 0) |
|
| 273 | 273 | { |
| 274 | 274 | $this->query['exclude_place_ids'] = implode(', ', $args); |
| 275 | 275 | |
@@ -303,9 +303,9 @@ discard block |
||
| 303 | 303 | */ |
| 304 | 304 | public function polygon($polygon) |
| 305 | 305 | { |
| 306 | - if(in_array($polygon, $this->polygon)) |
|
| 306 | + if (in_array($polygon, $this->polygon)) |
|
| 307 | 307 | { |
| 308 | - $this->query['polygon_'.$polygon] = "1"; |
|
| 308 | + $this->query['polygon_' . $polygon] = "1"; |
|
| 309 | 309 | |
| 310 | 310 | return $this; |
| 311 | 311 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function __construct(array $query = []) |
| 46 | 46 | { |
| 47 | - if(!isset($query['format'])) |
|
| 47 | + if (!isset($query['format'])) |
|
| 48 | 48 | { |
| 49 | 49 | //Default format |
| 50 | 50 | $query['format'] = 'json'; |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | { |
| 71 | 71 | $format = strtolower($format); |
| 72 | 72 | |
| 73 | - if(in_array($format, $this->accepteFormat)) |
|
| 73 | + if (in_array($format, $this->accepteFormat)) |
|
| 74 | 74 | { |
| 75 | 75 | $this->query['format'] = $format; |
| 76 | 76 | $this->setFormat($format); |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | */ |
| 110 | 110 | public function osmType($type) |
| 111 | 111 | { |
| 112 | - if(in_array($type, $this->osmType)) |
|
| 112 | + if (in_array($type, $this->osmType)) |
|
| 113 | 113 | { |
| 114 | 114 | $this->query['osm_type'] = $type; |
| 115 | 115 | |
@@ -189,9 +189,9 @@ discard block |
||
| 189 | 189 | */ |
| 190 | 190 | public function polygon($polygon) |
| 191 | 191 | { |
| 192 | - if(in_array($polygon, $this->polygon)) |
|
| 192 | + if (in_array($polygon, $this->polygon)) |
|
| 193 | 193 | { |
| 194 | - $this->query['polygon_'.$polygon] = "1"; |
|
| 194 | + $this->query['polygon_' . $polygon] = "1"; |
|
| 195 | 195 | |
| 196 | 196 | return $this; |
| 197 | 197 | } |