@@ -94,8 +94,8 @@ discard block |
||
94 | 94 | ]; |
95 | 95 | } |
96 | 96 | |
97 | - $request = []; |
|
98 | - $request['ValidateAddressesRequest'] = [ |
|
97 | + $request = [ ]; |
|
98 | + $request[ 'ValidateAddressesRequest' ] = [ |
|
99 | 99 | 'AddressToValidateList' => [ |
100 | 100 | 'AddressToValidate' => [ |
101 | 101 | $addressToValidate, |
@@ -115,15 +115,15 @@ discard block |
||
115 | 115 | |
116 | 116 | // no result |
117 | 117 | if (empty($json->ValidateAddressesResponse->ValidatedAddressResultList->ValidatedAddressResult)) { |
118 | - return new AddressCollection([]); |
|
118 | + return new AddressCollection([ ]); |
|
119 | 119 | } |
120 | 120 | |
121 | - $results = []; |
|
121 | + $results = [ ]; |
|
122 | 122 | foreach ($json->ValidateAddressesResponse->ValidatedAddressResultList->ValidatedAddressResult as $location) { |
123 | - if (isset($location->ValidatedAddressList->ValidatedAddress[0]->ServicePointDetail, $location->ValidatedAddressList->ValidatedAddress[0]->PostalAddress)) { |
|
124 | - $coordinates = $location->ValidatedAddressList->ValidatedAddress[0]->ServicePointDetail->GeographicalLocationInfo->GeographicalLocation; |
|
123 | + if (isset($location->ValidatedAddressList->ValidatedAddress[ 0 ]->ServicePointDetail, $location->ValidatedAddressList->ValidatedAddress[ 0 ]->PostalAddress)) { |
|
124 | + $coordinates = $location->ValidatedAddressList->ValidatedAddress[ 0 ]->ServicePointDetail->GeographicalLocationInfo->GeographicalLocation; |
|
125 | 125 | |
126 | - $postalAddress = $location->ValidatedAddressList->ValidatedAddress[0]->PostalAddress; |
|
126 | + $postalAddress = $location->ValidatedAddressList->ValidatedAddress[ 0 ]->PostalAddress; |
|
127 | 127 | |
128 | 128 | $streetName = !empty($postalAddress->StructuredDeliveryPointLocation->StreetName) ? $postalAddress->StructuredDeliveryPointLocation->StreetName : null; |
129 | 129 | $number = !empty($postalAddress->StructuredDeliveryPointLocation->StreetNumber) ? $postalAddress->StructuredDeliveryPointLocation->StreetNumber : null; |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | ->setPostalCode($postCode) |
140 | 140 | ->setCountry($country); |
141 | 141 | |
142 | - $results[] = $builder->build(); |
|
142 | + $results[ ] = $builder->build(); |
|
143 | 143 | } |
144 | 144 | } |
145 | 145 |