1 | <?php |
||
24 | class Nominatim |
||
25 | { |
||
26 | /** |
||
27 | * Contain url of the current application. |
||
28 | * |
||
29 | * @var string |
||
30 | */ |
||
31 | private $application_url; |
||
32 | |||
33 | /** |
||
34 | * Contain default request headers. |
||
35 | * |
||
36 | * @var array |
||
37 | */ |
||
38 | private $defaultHeaders; |
||
39 | |||
40 | /** |
||
41 | * Contain http client connection. |
||
42 | * |
||
43 | * @var \GuzzleHttp\Client |
||
44 | */ |
||
45 | private $http_client; |
||
46 | |||
47 | /** |
||
48 | * The search object which serves as a template for new ones created |
||
49 | * by 'newSearch()' method. |
||
50 | * |
||
51 | * @var \maxh\Nominatim\Search |
||
52 | */ |
||
53 | private $baseSearch; |
||
54 | |||
55 | /** |
||
56 | * Template for new ones created by 'newReverser()' method. |
||
57 | * |
||
58 | * @var \maxh\Nominatim\Reverse |
||
59 | */ |
||
60 | private $baseReverse; |
||
61 | |||
62 | 5 | /** |
|
63 | * Template for new ones created by 'newLookup()' method. |
||
64 | * |
||
65 | 1 | * @var \maxh\Nominatim\Lookup |
|
66 | */ |
||
67 | 5 | private $baseLookup; |
|
68 | |||
69 | /** |
||
70 | * Template for new ones created by 'newDetails()' method. |
||
71 | 5 | * |
|
72 | 5 | * @var \maxh\Nominatim\Lookup |
|
73 | 5 | */ |
|
74 | 5 | private $baseDetails; |
|
75 | 5 | ||
76 | 5 | /** |
|
77 | 5 | * Constructor. |
|
78 | * |
||
79 | * @param string $application_url Contain url of the current application |
||
80 | * @param \GuzzleHttp\Client|null $http_client Client object from Guzzle |
||
81 | * @param array $defaultHeaders Define default header for all request |
||
82 | * |
||
83 | * @throws NominatimException |
||
84 | */ |
||
85 | public function __construct( |
||
124 | |||
125 | 2 | /** |
|
126 | * Returns a new search object based on the base search. |
||
127 | * |
||
128 | * @return \maxh\Nominatim\Search |
||
129 | */ |
||
130 | public function newSearch(): Search |
||
134 | |||
135 | /** |
||
136 | * Returns a new reverse object based on the base reverse. |
||
137 | * |
||
138 | * @return \maxh\Nominatim\Reverse |
||
139 | */ |
||
140 | public function newReverse(): Reverse |
||
144 | |||
145 | /** |
||
146 | * Returns a new lookup object based on the base lookup. |
||
147 | * |
||
148 | * @return \maxh\Nominatim\Lookup |
||
149 | */ |
||
150 | public function newLookup(): Lookup |
||
154 | |||
155 | /** |
||
156 | * Returns a new datails object based on the base details. |
||
157 | * |
||
158 | * @return \maxh\Nominatim\Details |
||
159 | */ |
||
160 | public function newDetails(): Details |
||
164 | |||
165 | /** |
||
166 | * Decode the data returned from the request. |
||
167 | * |
||
168 | * @param string $format json or xml |
||
169 | * @param Request $request Request object from Guzzle |
||
170 | * @param ResponseInterface $response Interface response object from Guzzle |
||
171 | * |
||
172 | * @throws \RuntimeException |
||
173 | * @throws \maxh\Nominatim\Exceptions\NominatimException if no format for decode |
||
174 | * |
||
175 | * @return array|\SimpleXMLElement |
||
176 | */ |
||
177 | private function decodeResponse(string $format, Request $request, ResponseInterface $response) |
||
189 | |||
190 | /** |
||
191 | * Runs the query and returns the result set from Nominatim. |
||
192 | * |
||
193 | * @param QueryInterface $nRequest The object request to send |
||
194 | * @param array $headers Override the request header |
||
195 | * |
||
196 | * @throws NominatimException if no format for decode |
||
197 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
198 | * |
||
199 | * @return array|\SimpleXMLElement The decoded data returned from Nominatim |
||
200 | */ |
||
201 | public function find(QueryInterface $nRequest, array $headers = []) |
||
218 | |||
219 | /** |
||
220 | * Return the client using by instance. |
||
221 | */ |
||
222 | public function getClient(): Client |
||
226 | } |
||
227 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..