@@ -82,7 +82,7 @@ public function __construct(string $key, string $secret, string $platform)
8282 }
8383
8484 /**
85- * @see https://developer.postcode.eu/documentation// international/v1/Autocomplete/autocomplete
85+ * @see https://developer.postcode.eu/documentation/international/v1/Autocomplete/autocomplete
8686 */
8787 public function internationalAutocomplete (string $ context , string $ term , string $ session , string $ language = null ): array
8888 {
@@ -100,7 +100,7 @@ public function internationalAutocomplete(string $context, string $term, string
100100 }
101101
102102 /**
103- * @see https://developer.postcode.eu/documentation// international/v1/Autocomplete/getDetails
103+ * @see https://developer.postcode.eu/documentation/international/v1/Autocomplete/getDetails
104104 */
105105 public function internationalGetDetails (string $ context , string $ session ): array
106106 {
@@ -110,15 +110,15 @@ public function internationalGetDetails(string $context, string $session): array
110110 }
111111
112112 /**
113- * @see https://developer.postcode.eu/documentation// international/v1/Autocomplete/getSupportedCountries
113+ * @see https://developer.postcode.eu/documentation/international/v1/Autocomplete/getSupportedCountries
114114 */
115115 public function internationalGetSupportedCountries (): array
116116 {
117117 return $ this ->_performApiCall ('international/v1/supported-countries ' , null );
118118 }
119119
120120 /**
121- * @see https://developer.postcode.eu/documentation// nl/v1/Address/viewByPostcode
121+ * @see https://developer.postcode.eu/documentation/nl/v1/Address/viewByPostcode
122122 */
123123 public function dutchAddressByPostcode (string $ postcode , int $ houseNumber , ?string $ houseNumberAddition = null ): array
124124 {
@@ -143,7 +143,7 @@ public function dutchAddressByPostcode(string $postcode, int $houseNumber, ?stri
143143 }
144144
145145 /**
146- * @see https://developer.postcode.eu/documentation// nl/v1/Address/matchExact
146+ * @see https://developer.postcode.eu/documentation/nl/v1/Address/matchExact
147147 */
148148 public function dutchAddressExactMatch (string $ city , string $ street , int $ houseNumber , string $ houseNumberAddition = '' ): array
149149 {
@@ -159,7 +159,7 @@ public function dutchAddressExactMatch(string $city, string $street, int $houseN
159159 }
160160
161161 /**
162- * @see https://developer.postcode.eu/documentation// nl/v1/Address/viewByRd
162+ * @see https://developer.postcode.eu/documentation/nl/v1/Address/viewByRd
163163 */
164164 public function dutchAddressRD (float $ rdX , float $ rdY ): array
165165 {
@@ -173,7 +173,7 @@ public function dutchAddressRD(float $rdX, float $rdY): array
173173 }
174174
175175 /**
176- * @see https://developer.postcode.eu/documentation// nl/v1/Address/viewByLatLon
176+ * @see https://developer.postcode.eu/documentation/nl/v1/Address/viewByLatLon
177177 */
178178 public function dutchAddressLatLon (float $ latitude , float $ longitude ): array
179179 {
@@ -187,7 +187,7 @@ public function dutchAddressLatLon(float $latitude, float $longitude): array
187187 }
188188
189189 /**
190- * @see https://developer.postcode.eu/documentation// nl/v1/Address/viewByBagNumberDesignationId
190+ * @see https://developer.postcode.eu/documentation/nl/v1/Address/viewByBagNumberDesignationId
191191 */
192192 public function dutchAddressBagNumberDesignation (string $ bagNumberDesignationId ): array
193193 {
@@ -200,7 +200,7 @@ public function dutchAddressBagNumberDesignation(string $bagNumberDesignationId)
200200 }
201201
202202 /**
203- * @see https://developer.postcode.eu/documentation// nl/v1/Address/viewByBagAddressableObjectId
203+ * @see https://developer.postcode.eu/documentation/nl/v1/Address/viewByBagAddressableObjectId
204204 */
205205 public function dutchAddressBagAddressableObject (string $ bagAddressableObjectId ): array
206206 {
@@ -213,7 +213,7 @@ public function dutchAddressBagAddressableObject(string $bagAddressableObjectId)
213213 }
214214
215215 /**
216- * @see https://developer.postcode.eu/documentation// nl/v1/PostcodeRange/viewByPostcode
216+ * @see https://developer.postcode.eu/documentation/nl/v1/PostcodeRange/viewByPostcode
217217 */
218218 public function dutchAddressPostcodeRanges (string $ postcode ): array
219219 {
@@ -233,7 +233,50 @@ public function dutchAddressPostcodeRanges(string $postcode): array
233233 }
234234
235235 /**
236- * @see https://developer.postcode.eu/documentation//account/v1/Account/getInfo
236+ * @see https://developer.postcode.eu/documentation/international/v1/Validate/validate
237+ */
238+ public function validate (string $ country , ?string $ postcode = null , ?string $ locality = null , ?string $ street = null , ?string $ building = null , ?string $ region = null , ?string $ streetAndBuilding = null ): array
239+ {
240+ $ urlParts = [
241+ 'international/v1/validate ' ,
242+ rawurlencode ($ country )
243+ ];
244+ $ variables = [
245+ 'postcode ' => $ postcode ,
246+ 'locality ' => $ locality ,
247+ 'street ' => $ street ,
248+ 'building ' => $ building ,
249+ 'region ' => $ region ,
250+ 'streetAndBuilding ' => $ streetAndBuilding ,
251+ ];
252+ $ parameters = [];
253+ foreach ($ variables as $ key => $ value )
254+ {
255+ if ($ value === null )
256+ {
257+ continue ;
258+ }
259+ $ parameters [] = $ key . '= ' . rawurlencode ($ value );
260+ }
261+
262+ return $ this ->_performApiCall (implode ('/ ' , $ urlParts ) . '? ' . implode ('& ' , $ parameters ), null );
263+ }
264+
265+ /**
266+ * @see https://developer.postcode.eu/documentation/international/v1/Validate/getCountry
267+ */
268+ public function getCountry (string $ country ): array
269+ {
270+ $ urlParts = [
271+ 'international/v1/country ' ,
272+ rawurlencode ($ country ),
273+ ];
274+
275+ return $ this ->_performApiCall (implode ('/ ' , $ urlParts ), null );
276+ }
277+
278+ /**
279+ * @see https://developer.postcode.eu/documentation/account/v1/Account/getInfo
237280 */
238281 public function accountInfo (): array
239282 {
0 commit comments