@@ -2,8 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Ups\Entity\Tradeability; |
| 4 | 4 | |
| 5 | -use DomDocument; |
|
| 6 | -use DomElement; |
|
| 7 | 5 | use Ups\Entity\FreightCharges; |
| 8 | 6 | use Ups\NodeInterface; |
| 9 | 7 | |
@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use DOMDocument; |
| 6 | 6 | use Exception; |
| 7 | 7 | use SimpleXMLElement; |
| 8 | -use stdClass; |
|
| 9 | 8 | use Ups\Entity\LabelRecoveryRequest; |
| 10 | 9 | use Ups\Entity\LabelRecoveryResponse; |
| 11 | 10 | |
@@ -7,7 +7,6 @@ |
||
| 7 | 7 | use Psr\Log\LoggerInterface; |
| 8 | 8 | use SimpleXMLElement; |
| 9 | 9 | use Ups\Entity\LocatorRequest; |
| 10 | -use Ups\Entity\TimeInTransitRequest; |
|
| 11 | 10 | |
| 12 | 11 | /** |
| 13 | 12 | * Locator API Wrapper. |
@@ -128,7 +128,7 @@ |
||
| 128 | 128 | } |
| 129 | 129 | if ($this->useAVResponseObject) { |
| 130 | 130 | unset($response->Response); |
| 131 | - $avResponse = new AddressValidationResponse($response,$requestOption); |
|
| 131 | + $avResponse = new AddressValidationResponse($response, $requestOption); |
|
| 132 | 132 | return $avResponse; |
| 133 | 133 | } |
| 134 | 134 | return $this->formatResponse($response); |
@@ -64,9 +64,9 @@ |
||
| 64 | 64 | * @param string $extendedDivider |
| 65 | 65 | * @return string |
| 66 | 66 | */ |
| 67 | - public function getPostalCode($withExtended = false,$extendedDivider = '-') |
|
| 67 | + public function getPostalCode($withExtended = false, $extendedDivider = '-') |
|
| 68 | 68 | { |
| 69 | - if($withExtended) { |
|
| 69 | + if ($withExtended) { |
|
| 70 | 70 | return $this->postcodePrimaryLow . $extendedDivider . $this->postcodeExtendedLow; |
| 71 | 71 | } |
| 72 | 72 | return $this->postcodePrimaryLow; |
@@ -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 | |