@@ -136,43 +136,43 @@ |
||
| 136 | 136 | $patterns = [ |
| 137 | 137 | |
| 138 | 138 | // UPS Mail Innovations tracking numbers |
| 139 | - '/^MI\d{6}\d{1,22}$/',// MI 000000 00000000+ |
|
| 139 | + '/^MI\d{6}\d{1,22}$/', // MI 000000 00000000+ |
|
| 140 | 140 | |
| 141 | 141 | // USPS - Certified Mail |
| 142 | - '/^94071\d{17}$/', // 9407 1000 0000 0000 0000 00 |
|
| 143 | - '/^7\d{19}$/', // 7000 0000 0000 0000 0000 |
|
| 142 | + '/^94071\d{17}$/', // 9407 1000 0000 0000 0000 00 |
|
| 143 | + '/^7\d{19}$/', // 7000 0000 0000 0000 0000 |
|
| 144 | 144 | |
| 145 | 145 | // USPS - Collect on Delivery |
| 146 | - '/^93033\d{17}$/', // 9303 3000 0000 0000 0000 00 |
|
| 147 | - '/^M\d{9}$/', // M000 0000 00 |
|
| 146 | + '/^93033\d{17}$/', // 9303 3000 0000 0000 0000 00 |
|
| 147 | + '/^M\d{9}$/', // M000 0000 00 |
|
| 148 | 148 | |
| 149 | 149 | // USPS - Global Express Guaranteed |
| 150 | - '/^82\d{10}$/', // 82 000 000 00 |
|
| 150 | + '/^82\d{10}$/', // 82 000 000 00 |
|
| 151 | 151 | |
| 152 | 152 | // USPS - Priority Mail Express International |
| 153 | - '/^EC\d{9}US$/', // EC 000 000 000 US |
|
| 153 | + '/^EC\d{9}US$/', // EC 000 000 000 US |
|
| 154 | 154 | |
| 155 | 155 | // USPS - Priority Mail Express |
| 156 | - '/^927\d{19}$/', // 9270 1000 0000 0000 0000 00 |
|
| 157 | - '/^EA\d{9}US$/', // EA 000 000 000 US |
|
| 156 | + '/^927\d{19}$/', // 9270 1000 0000 0000 0000 00 |
|
| 157 | + '/^EA\d{9}US$/', // EA 000 000 000 US |
|
| 158 | 158 | |
| 159 | 159 | // USPS - Priority Mail International |
| 160 | - '/^CP\d{9}US$/', // CP 000 000 000 US |
|
| 160 | + '/^CP\d{9}US$/', // CP 000 000 000 US |
|
| 161 | 161 | |
| 162 | 162 | // USPS - Priority Mail |
| 163 | - '/^92055\d{17}$/', // 9205 5000 0000 0000 0000 00 |
|
| 164 | - '/^14\d{18}$/', // 1400 0000 0000 0000 0000 |
|
| 163 | + '/^92055\d{17}$/', // 9205 5000 0000 0000 0000 00 |
|
| 164 | + '/^14\d{18}$/', // 1400 0000 0000 0000 0000 |
|
| 165 | 165 | |
| 166 | 166 | // USPS - Registered Mail |
| 167 | - '/^92088\d{17}$/', // 9208 8000 0000 0000 0000 00 |
|
| 168 | - '/^RA\d{9}US$/', // RA 000 000 000 US |
|
| 167 | + '/^92088\d{17}$/', // 9208 8000 0000 0000 0000 00 |
|
| 168 | + '/^RA\d{9}US$/', // RA 000 000 000 US |
|
| 169 | 169 | |
| 170 | 170 | // USPS - Signature Confirmation |
| 171 | - '/^9202\d{16}US$/', // 9202 1000 0000 0000 0000 00 |
|
| 172 | - '/^23\d{16}US$/', // 2300 0000 0000 0000 0000 |
|
| 171 | + '/^9202\d{16}US$/', // 9202 1000 0000 0000 0000 00 |
|
| 172 | + '/^23\d{16}US$/', // 2300 0000 0000 0000 0000 |
|
| 173 | 173 | |
| 174 | 174 | // USPS - Tracking |
| 175 | - '/^94\d{20}$/', // 9400 1000 0000 0000 0000 00 |
|
| 175 | + '/^94\d{20}$/', // 9400 1000 0000 0000 0000 00 |
|
| 176 | 176 | '/^03\d{18}$/' // 0300 0000 0000 0000 0000 |
| 177 | 177 | ]; |
| 178 | 178 | |
@@ -212,6 +212,6 @@ |
||
| 212 | 212 | { |
| 213 | 213 | $base = ($this->useIntegration ? $this->integrationBaseUrl : $this->productionBaseUrl); |
| 214 | 214 | |
| 215 | - return $base . $segment; |
|
| 215 | + return $base.$segment; |
|
| 216 | 216 | } |
| 217 | 217 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | 'endpointurl' => $this->getEndpointUrl(), |
| 85 | 85 | ]); |
| 86 | 86 | |
| 87 | - $this->logger->debug('Request: ' . $this->getRequest(), [ |
|
| 87 | + $this->logger->debug('Request: '.$this->getRequest(), [ |
|
| 88 | 88 | 'id' => $id, |
| 89 | 89 | 'endpointurl' => $this->getEndpointUrl(), |
| 90 | 90 | ]); |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | $response = $client->post( |
| 96 | 96 | $this->getEndpointUrl(), |
| 97 | 97 | [ |
| 98 | - 'body' => $this->getAccess() . $this->getRequest(), |
|
| 98 | + 'body' => $this->getAccess().$this->getRequest(), |
|
| 99 | 99 | 'headers' => [ |
| 100 | 100 | 'Content-type' => 'application/x-www-form-urlencoded; charset=utf-8', |
| 101 | 101 | 'Accept-Charset' => 'UTF-8', |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | 'endpointurl' => $this->getEndpointUrl(), |
| 112 | 112 | ]); |
| 113 | 113 | |
| 114 | - $this->logger->debug('Response: ' . $body, [ |
|
| 114 | + $this->logger->debug('Response: '.$body, [ |
|
| 115 | 115 | 'id' => $id, |
| 116 | 116 | 'endpointurl' => $this->getEndpointUrl(), |
| 117 | 117 | ]); |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | return $responseInstance->setText($body)->setResponse($xml); |
| 130 | 130 | } elseif ($xml->Response->ResponseStatusCode == 0) { |
| 131 | - throw new InvalidResponseException('Failure: ' . $xml->Response->Error->ErrorDescription . ' (' . $xml->Response->Error->ErrorCode . ')'); |
|
| 131 | + throw new InvalidResponseException('Failure: '.$xml->Response->Error->ErrorDescription.' ('.$xml->Response->Error->ErrorCode.')'); |
|
| 132 | 132 | } |
| 133 | 133 | } else { |
| 134 | 134 | throw new InvalidResponseException('Failure: response is in an unexpected format.'); |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | 'endpointurl' => $this->getEndpointUrl(), |
| 141 | 141 | ]); |
| 142 | 142 | |
| 143 | - throw new RequestException('Failure: ' . $e->getMessage()); |
|
| 143 | + throw new RequestException('Failure: '.$e->getMessage()); |
|
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | |
@@ -40,9 +40,9 @@ |
||
| 40 | 40 | $node = $document->createElement('AddressArtifactFormat'); |
| 41 | 41 | |
| 42 | 42 | for ($i = 1; $i <= 3; $i++) { |
| 43 | - $line = $this->{'getPoliticalDivision' . $i}(); |
|
| 43 | + $line = $this->{'getPoliticalDivision'.$i}(); |
|
| 44 | 44 | if ($line) { |
| 45 | - $node->appendChild($document->createElement('PoliticalDivision' . $i, $line)); |
|
| 45 | + $node->appendChild($document->createElement('PoliticalDivision'.$i, $line)); |
|
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | public function __construct(\SimpleXMLElement $object) |
| 9 | 9 | { |
| 10 | 10 | if ($object->count() == 0) { |
| 11 | - throw new \InvalidArgumentException(__METHOD__ . ': The passed object does not have any child nodes.'); |
|
| 11 | + throw new \InvalidArgumentException(__METHOD__.': The passed object does not have any child nodes.'); |
|
| 12 | 12 | } |
| 13 | 13 | $this->code = $object->Code; |
| 14 | 14 | $this->description = $object->Description; |
@@ -62,15 +62,15 @@ discard block |
||
| 62 | 62 | public function __construct(\SimpleXMLElement $xmlDoc) |
| 63 | 63 | { |
| 64 | 64 | if ($xmlDoc->count() == 0) { |
| 65 | - throw new \InvalidArgumentException(__METHOD__ . ': The passed object does not have any child nodes.'); |
|
| 65 | + throw new \InvalidArgumentException(__METHOD__.': The passed object does not have any child nodes.'); |
|
| 66 | 66 | } |
| 67 | 67 | $this->addressClassification = isset($xmlDoc->AddressClassification) ? new AddressClassification($xmlDoc->AddressClassification) : null; |
| 68 | 68 | $this->consigneeName = isset($xmlDoc->ConsigneeName) ? (string)$xmlDoc->ConsigneeName : ''; |
| 69 | 69 | $this->buildingName = isset($xmlDoc->BuildingName) ? (string)$xmlDoc->BuildingName : ''; |
| 70 | 70 | if (isset($xmlDoc->AddressLine)) { |
| 71 | 71 | for ($i = 0, $len = count($xmlDoc->AddressLine); $i < $len; $i++) { |
| 72 | - $var = 'addressLine' . ($i > 0 ? $i + 1 : ''); |
|
| 73 | - $this->{$var} = isset($xmlDoc->AddressLine[$i]) ? (string) $xmlDoc->AddressLine[$i] : ''; |
|
| 72 | + $var = 'addressLine'.($i > 0 ? $i + 1 : ''); |
|
| 73 | + $this->{$var} = isset($xmlDoc->AddressLine[$i]) ? (string)$xmlDoc->AddressLine[$i] : ''; |
|
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | $this->region = isset($xmlDoc->Region) ? (string)$xmlDoc->Region : ''; |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | */ |
| 155 | 155 | public function getPostalCodeWithExtension($divider = '-') |
| 156 | 156 | { |
| 157 | - return $this->postcodePrimaryLow . $divider . $this->postcodeExtendedLow; |
|
| 157 | + return $this->postcodePrimaryLow.$divider.$this->postcodeExtendedLow; |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | /** |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | */ |
| 166 | 166 | public function getAddressLine($lineNumber = 1) |
| 167 | 167 | { |
| 168 | - $var = 'addressLine' . ($lineNumber > 1 ? $lineNumber : ''); |
|
| 168 | + $var = 'addressLine'.($lineNumber > 1 ? $lineNumber : ''); |
|
| 169 | 169 | return $this->{$var}; |
| 170 | 170 | } |
| 171 | 171 | } |
@@ -80,7 +80,7 @@ |
||
| 80 | 80 | |
| 81 | 81 | $node = $document->createElement('Product'); |
| 82 | 82 | for ($i = 1; $i <= 3; $i++) { |
| 83 | - $desc = $this->{'getDescription' . $i}(); |
|
| 83 | + $desc = $this->{'getDescription'.$i}(); |
|
| 84 | 84 | if ($desc !== null) { |
| 85 | 85 | $node->appendChild($document->createElement('Description', $desc)); |
| 86 | 86 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | public function noCandidates() |
| 32 | 32 | { |
| 33 | 33 | if (AddressValidation::REQUEST_OPTION_ADDRESS_CLASSIFICATION == $this->requestAction) { |
| 34 | - throw new \BadMethodCallException(__METHOD__ . ' should not be called on Address Classification only requests.'); |
|
| 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 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | public function isAmbiguous() |
| 63 | 63 | { |
| 64 | 64 | if (AddressValidation::REQUEST_OPTION_ADDRESS_CLASSIFICATION == $this->requestAction) { |
| 65 | - throw new \BadMethodCallException(__METHOD__ . ' should not be called on Address Classification only requests.'); |
|
| 65 | + throw new \BadMethodCallException(__METHOD__.' should not be called on Address Classification only requests.'); |
|
| 66 | 66 | } |
| 67 | 67 | return isset($this->response->AmbiguousAddressIndicator); |
| 68 | 68 | } |
@@ -60,16 +60,16 @@ |
||
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | for ($i = 1; $i <= 3; $i++) { |
| 63 | - $line = $this->{'getAddressLine' . $i}(); |
|
| 63 | + $line = $this->{'getAddressLine'.$i}(); |
|
| 64 | 64 | if ($line) { |
| 65 | - $node->appendChild($document->createElement('AddressLine' . ($i == 1 ? '' : $i), $line)); |
|
| 65 | + $node->appendChild($document->createElement('AddressLine'.($i == 1 ? '' : $i), $line)); |
|
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | for ($i = 1; $i <= 3; $i++) { |
| 70 | - $line = $this->{'getPoliticalDivision' . $i}(); |
|
| 70 | + $line = $this->{'getPoliticalDivision'.$i}(); |
|
| 71 | 71 | if ($line) { |
| 72 | - $node->appendChild($document->createElement('PoliticalDivision' . $i, $line)); |
|
| 72 | + $node->appendChild($document->createElement('PoliticalDivision'.$i, $line)); |
|
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | |