Skip to content

Commit

Permalink
Apply fixes from StyleCI (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbelien authored Jan 3, 2018
1 parent 72a0d3d commit bb96dec
Showing 1 changed file with 36 additions and 35 deletions.
71 changes: 36 additions & 35 deletions bpost.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,40 +58,40 @@ public function geocodeQuery(GeocodeQuery $query): Collection
throw new InvalidArgument('Address cannot be empty.');
}

$request = array();
$request['ValidateAddressesRequest'] = array(
'AddressToValidateList' => array(
'AddressToValidate' => array(
array(
'@id' => 1,
'PostalAddress' => array(
'DeliveryPointLocation' => array(
'StructuredDeliveryPointLocation' => array(
'StreetName' => $query->getData('streetName'),
'StreetNumber' => $query->getData('streetNumber')
)
),
'PostalCodeMunicipality' => array(
'StructuredPostalCodeMunicipality' => array(
'PostalCode' => $query->getData('postalCode', ''),
'MunicipalityName' => $query->getData('locality', '')
)
)
),
'DeliveringCountryISOCode' => 'BE',
'DispatchingCountryISOCode' => 'BE'
)
)
),
'ValidateAddressOptions' => array(
'IncludeSuggestions' => false,
$request = [];
$request['ValidateAddressesRequest'] = [
'AddressToValidateList' => [
'AddressToValidate' => [
[
'@id' => 1,
'PostalAddress' => [
'DeliveryPointLocation' => [
'StructuredDeliveryPointLocation' => [
'StreetName' => $query->getData('streetName'),
'StreetNumber' => $query->getData('streetNumber'),
],
],
'PostalCodeMunicipality' => [
'StructuredPostalCodeMunicipality' => [
'PostalCode' => $query->getData('postalCode', ''),
'MunicipalityName' => $query->getData('locality', ''),
],
],
],
'DeliveringCountryISOCode' => 'BE',
'DispatchingCountryISOCode' => 'BE',
],
],
],
'ValidateAddressOptions' => [
'IncludeSuggestions' => false,
'IncludeDefaultGeoLocation' => true,
'IncludeSubmittedAddress' => true
),
'CallerIdentification' => array(
'CallerName' => 'Geocoder PHP'
)
);
'IncludeSubmittedAddress' => true,
],
'CallerIdentification' => [
'CallerName' => 'Geocoder PHP',
],
];

$json = $this->executeQuery(self::GEOCODE_ENDPOINT_URL, json_encode($request));

Expand Down Expand Up @@ -163,9 +163,9 @@ private function executeQuery(string $url, string $data): \stdClass
* @param string $url
* @param string $body
*
* @return string
*
* @throws InvalidServerResponse
*
* @return string
*/
protected function postUrlContents(string $url, string $body): string
{
Expand All @@ -183,6 +183,7 @@ protected function postUrlContents(string $url, string $body): string
if (empty($body)) {
throw InvalidServerResponse::emptyResponse($url);
}

return $body;
}
}

0 comments on commit bb96dec

Please sign in to comment.