@@ -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 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * |
63 | 63 | * @param string $format The output format for the request |
64 | 64 | * |
65 | - * @return maxh\Nominatim\Query |
|
65 | + * @return Query |
|
66 | 66 | * @throws maxh\Nominatim\Exceptions\InvalidParameterException if format is not supported |
67 | 67 | */ |
68 | 68 | public function format($format) |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * @param string $language Preferred language order for showing search results, overrides the value specified in the "Accept-Language" HTTP header. |
90 | 90 | * Either uses standard rfc2616 accept-language string or a simple comma separated list of language codes. |
91 | 91 | * |
92 | - * @return maxh\Nominatim\Query |
|
92 | + * @return Query |
|
93 | 93 | */ |
94 | 94 | public function language($language) |
95 | 95 | { |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * |
104 | 104 | * @param boolean $details |
105 | 105 | * |
106 | - * @return maxh\Nominatim\Query |
|
106 | + * @return Query |
|
107 | 107 | */ |
108 | 108 | public function addressDetails($details = true) |
109 | 109 | { |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * |
118 | 118 | * @param boolean $tags |
119 | 119 | * |
120 | - * @return maxh\Nominatim\Query |
|
120 | + * @return Query |
|
121 | 121 | */ |
122 | 122 | public function extraTags($tags = true) |
123 | 123 | { |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | * |
133 | 133 | * @param boolean $details |
134 | 134 | * |
135 | - * @return maxh\Nominatim\Query |
|
135 | + * @return Query |
|
136 | 136 | */ |
137 | 137 | public function nameDetails($details = true) |
138 | 138 | { |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | * |
148 | 148 | * @param string $email Address mail |
149 | 149 | * |
150 | - * @return maxh\Nominatim\Query |
|
150 | + * @return Query |
|
151 | 151 | */ |
152 | 152 | public function email($email) |
153 | 153 | { |
@@ -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'; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | { |
70 | 70 | $format = strtolower($format); |
71 | 71 | |
72 | - if(in_array($format, $this->accepteFormat)) |
|
72 | + if (in_array($format, $this->accepteFormat)) |
|
73 | 73 | { |
74 | 74 | $this->query['format'] = $format; |
75 | 75 | $this->setFormat($format); |
@@ -19,9 +19,9 @@ |
||
19 | 19 | { |
20 | 20 | |
21 | 21 | /** |
22 | - * Output format accepted |
|
23 | - * @var array |
|
24 | - */ |
|
22 | + * Output format accepted |
|
23 | + * @var array |
|
24 | + */ |
|
25 | 25 | public $accepteFormat = ['html', 'xml', 'json', 'jsonv2']; |
26 | 26 | |
27 | 27 |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | { |
203 | 203 | $args = func_get_args(); |
204 | 204 | |
205 | - if(count($args) > 0) |
|
205 | + if (count($args) > 0) |
|
206 | 206 | { |
207 | 207 | $this->query['exclude_place_ids'] = implode(', ', $args); |
208 | 208 | |
@@ -236,9 +236,9 @@ discard block |
||
236 | 236 | */ |
237 | 237 | public function polygon($polygon) |
238 | 238 | { |
239 | - if(in_array($polygon, $this->polygon)) |
|
239 | + if (in_array($polygon, $this->polygon)) |
|
240 | 240 | { |
241 | - $this->query['polygon_'.$polygon] = "1"; |
|
241 | + $this->query['polygon_' . $polygon] = "1"; |
|
242 | 242 | |
243 | 243 | return $this; |
244 | 244 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function osmType($type) |
57 | 57 | { |
58 | - if(in_array($type, $this->osmType)) |
|
58 | + if (in_array($type, $this->osmType)) |
|
59 | 59 | { |
60 | 60 | $this->query['osm_type'] = $type; |
61 | 61 | |
@@ -121,9 +121,9 @@ discard block |
||
121 | 121 | */ |
122 | 122 | public function polygon($polygon) |
123 | 123 | { |
124 | - if(in_array($polygon, $this->polygon)) |
|
124 | + if (in_array($polygon, $this->polygon)) |
|
125 | 125 | { |
126 | - $this->query['polygon_'.$polygon] = "1"; |
|
126 | + $this->query['polygon_' . $polygon] = "1"; |
|
127 | 127 | |
128 | 128 | return $this; |
129 | 129 | } |