1 | <?php |
||
33 | class AdresseProvider extends AbstractProvider { |
||
34 | |||
35 | /** |
||
36 | * Endpoint path. |
||
37 | * |
||
38 | * @var string |
||
39 | */ |
||
40 | const ENDPOINT_PATH = "https://api-adresse.data.gouv.fr"; |
||
41 | |||
42 | /** |
||
43 | * Add an array. |
||
44 | * |
||
45 | * @param array $post The POST. |
||
46 | * @param string $name The name. |
||
47 | * @param array $data The data. |
||
48 | * @return void |
||
49 | */ |
||
50 | 10 | protected function appendArray(array &$post, string $name, array $data): void { |
|
63 | |||
64 | /** |
||
65 | * {@inheritDoc} |
||
66 | */ |
||
67 | 30 | public function getEndpointPath(): string { |
|
70 | |||
71 | /** |
||
72 | * Reverse. |
||
73 | * |
||
74 | * @param ReverseRequest $request The reverse request. |
||
75 | * @return FeatureCollection|null Returns the reverse response in case of success, null otherwise. |
||
76 | * @throws GuzzleException Throws a Guzzle exception if an error occurs. |
||
77 | * @throws ApiException Throws an API exception if an error occurs. |
||
78 | */ |
||
79 | 5 | public function reverse(ReverseRequest $request): ?FeatureCollection { |
|
87 | |||
88 | /** |
||
89 | * Reverse CSV. |
||
90 | * |
||
91 | * @param ReverseCsvRequest $request The reverse CSV request. |
||
92 | * @return ReverseCsvResponse Returns the reverse CSV response. |
||
93 | * @throws GuzzleException Throws a Guzzle exception if an error occurs. |
||
94 | * @throws ApiException Throws an API exception if an error occurs. |
||
95 | */ |
||
96 | 5 | public function reverseCsv(ReverseCsvRequest $request): ReverseCsvResponse { |
|
113 | |||
114 | /** |
||
115 | * Search. |
||
116 | * |
||
117 | * @param SearchRequest $request The search request. |
||
118 | * @return FeatureCollection|null Returns the search response in case of success, null otherwise. |
||
119 | * @throws GuzzleException Throws a Guzzle exception if an error occurs. |
||
120 | * @throws ApiException Throws an API exception if an error occurs. |
||
121 | */ |
||
122 | 5 | public function search(SearchRequest $request): FeatureCollection { |
|
130 | |||
131 | /** |
||
132 | * Search CSV. |
||
133 | * |
||
134 | * @param SearchCsvRequest $request The search CSV request. |
||
135 | * @return SearchCsvResponse Returns the search CSV response. |
||
136 | * @throws GuzzleException Throws a Guzzle exception if an error occurs. |
||
137 | * @throws ApiException Throws an API exception if an error occurs. |
||
138 | */ |
||
139 | 10 | public function searchCsv(SearchCsvRequest $request): SearchCsvResponse { |
|
158 | } |