@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | * @param \SimpleXMLElement $xmlDocument |
| 16 | 16 | * @param $requestAction |
| 17 | 17 | */ |
| 18 | - public function __construct(\SimpleXMLElement $xmlDocument,$requestAction) |
|
| 18 | + public function __construct(\SimpleXMLElement $xmlDocument, $requestAction) |
|
| 19 | 19 | { |
| 20 | 20 | $this->response = $xmlDocument; |
| 21 | 21 | $this->requestAction = $requestAction; |
@@ -30,8 +30,8 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | public function noCandidates() |
| 32 | 32 | { |
| 33 | - if(AddressValidation::REQUEST_OPTION_ADDRESS_CLASSIFICATION == $this->requestAction) { |
|
| 34 | - throw new \BadMethodCallException(__METHOD__.' should not be called on Address Classification only requests.'); |
|
| 33 | + if (AddressValidation::REQUEST_OPTION_ADDRESS_CLASSIFICATION == $this->requestAction) { |
|
| 34 | + throw new \BadMethodCallException(__METHOD__ . ' should not be called on Address Classification only requests.'); |
|
| 35 | 35 | } |
| 36 | 36 | return isset($this->response->NoCandidatesIndicator); |
| 37 | 37 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function isValid() |
| 46 | 46 | { |
| 47 | - if(AddressValidation::REQUEST_OPTION_ADDRESS_CLASSIFICATION == $this->requestAction) { |
|
| 47 | + if (AddressValidation::REQUEST_OPTION_ADDRESS_CLASSIFICATION == $this->requestAction) { |
|
| 48 | 48 | return $this->response->AddressClassification->Code > 0; |
| 49 | 49 | } |
| 50 | 50 | return isset($this->response->ValidAddressIndicator); |
@@ -60,8 +60,8 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | public function isAmbiguous() |
| 62 | 62 | { |
| 63 | - if(AddressValidation::REQUEST_OPTION_ADDRESS_CLASSIFICATION == $this->requestAction) { |
|
| 64 | - throw new \BadMethodCallException(__METHOD__.' should not be called on Address Classification only requests.'); |
|
| 63 | + if (AddressValidation::REQUEST_OPTION_ADDRESS_CLASSIFICATION == $this->requestAction) { |
|
| 64 | + throw new \BadMethodCallException(__METHOD__ . ' should not be called on Address Classification only requests.'); |
|
| 65 | 65 | } |
| 66 | 66 | return isset($this->response->AmbiguousAddressIndicator); |
| 67 | 67 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | public function getAddressClassification() |
| 74 | 74 | { |
| 75 | - if($this->requestAction < AddressValidation::REQUEST_OPTION_ADDRESS_CLASSIFICATION) { |
|
| 75 | + if ($this->requestAction < AddressValidation::REQUEST_OPTION_ADDRESS_CLASSIFICATION) { |
|
| 76 | 76 | throw new \BadMethodCallException('Address Classification was not requested.'); |
| 77 | 77 | } |
| 78 | 78 | return new AddressClassification($this->response->AddressClassification); |
@@ -83,11 +83,11 @@ discard block |
||
| 83 | 83 | */ |
| 84 | 84 | public function getCandidateAddressList() |
| 85 | 85 | { |
| 86 | - if(!isset($this->response->AddressKeyFormat)) { |
|
| 86 | + if (!isset($this->response->AddressKeyFormat)) { |
|
| 87 | 87 | return []; |
| 88 | 88 | } |
| 89 | 89 | $candidates = []; |
| 90 | - foreach($this->response->AddressKeyFormat as $address) { |
|
| 90 | + foreach ($this->response->AddressKeyFormat as $address) { |
|
| 91 | 91 | $candidates[] = new AVAddress($address); |
| 92 | 92 | } |
| 93 | 93 | return $candidates; |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | public function getValidatedAddress() |
| 97 | 97 | { |
| 98 | - if($this->requestAction == AddressValidation::REQUEST_OPTION_ADDRESS_CLASSIFICATION) { |
|
| 98 | + if ($this->requestAction == AddressValidation::REQUEST_OPTION_ADDRESS_CLASSIFICATION) { |
|
| 99 | 99 | throw new \BadMethodCallException('Only Address Classification was requested. There is no address.'); |
| 100 | 100 | } |
| 101 | 101 | |