@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | private static function decodeResponse(SimpleXMLElement $item, ?array $return = null, int $i = 0): array |
86 | 86 | { |
87 | - $arrayKeys = [ |
|
87 | + $arrayKeys = [ |
|
88 | 88 | 'barcode', |
89 | 89 | 'orderLine', |
90 | 90 | Insured::INSURANCE_TYPE_ADDITIONAL_INSURANCE, |
@@ -133,13 +133,13 @@ discard block |
||
133 | 133 | * @throws BpostInvalidSelectionException |
134 | 134 | * @throws BpostInvalidXmlResponseException |
135 | 135 | */ |
136 | - private function doCall(HttpRequestBuilderInterface $builder): string|SimpleXMLElement |
|
136 | + private function doCall(HttpRequestBuilderInterface $builder): string | SimpleXMLElement |
|
137 | 137 | { |
138 | 138 | $headers = $builder->getHeaders(); |
139 | - $headers[] = 'Authorization: Basic ' . $this->getAuthorizationHeader(); |
|
139 | + $headers[] = 'Authorization: Basic '.$this->getAuthorizationHeader(); |
|
140 | 140 | |
141 | 141 | $options = [ |
142 | - CURLOPT_URL => rtrim($this->apiUrl, '/') . '/' . rawurlencode($this->accountId) . $builder->getUrl(), |
|
142 | + CURLOPT_URL => rtrim($this->apiUrl, '/').'/'.rawurlencode($this->accountId).$builder->getUrl(), |
|
143 | 143 | CURLOPT_USERAGENT => $this->getUserAgent(), |
144 | 144 | CURLOPT_RETURNTRANSFER => true, |
145 | 145 | CURLOPT_TIMEOUT => $this->getTimeOut(), |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | |
198 | 198 | private function getAuthorizationHeader(): string |
199 | 199 | { |
200 | - return base64_encode($this->accountId . ':' . $this->passPhrase); |
|
200 | + return base64_encode($this->accountId.':'.$this->passPhrase); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | public function getPassPhrase(): string |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | |
218 | 218 | public function getUserAgent(): string |
219 | 219 | { |
220 | - return 'PHP Bpost/' . self::VERSION . ' ' . ($this->userAgent ?? ''); |
|
220 | + return 'PHP Bpost/'.self::VERSION.' '.($this->userAgent ?? ''); |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | public function setTimeOut(int $seconds): void |
@@ -52,14 +52,14 @@ |
||
52 | 52 | { |
53 | 53 | $packStation = new self(); |
54 | 54 | |
55 | - if (isset($xml->OrderNumber) && (string)$xml->OrderNumber !== '') { |
|
56 | - $packStation->setOrderNumber((string)$xml->OrderNumber); |
|
55 | + if (isset($xml->OrderNumber) && (string) $xml->OrderNumber !== '') { |
|
56 | + $packStation->setOrderNumber((string) $xml->OrderNumber); |
|
57 | 57 | } |
58 | - if (isset($xml->CustomLabel) && (string)$xml->CustomLabel !== '') { |
|
59 | - $packStation->setCustomLabel((string)$xml->CustomLabel); |
|
58 | + if (isset($xml->CustomLabel) && (string) $xml->CustomLabel !== '') { |
|
59 | + $packStation->setCustomLabel((string) $xml->CustomLabel); |
|
60 | 60 | } |
61 | - if (isset($xml->PackstationID) && (string)$xml->PackstationID !== '') { |
|
62 | - $packStation->setPackstationId((string)$xml->PackstationID); |
|
61 | + if (isset($xml->PackstationID) && (string) $xml->PackstationID !== '') { |
|
62 | + $packStation->setPackstationId((string) $xml->PackstationID); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | return $packStation; |
@@ -407,11 +407,11 @@ |
||
407 | 407 | ); |
408 | 408 | } |
409 | 409 | if (isset($xml->ReceivePromotions) && $xml->ReceivePromotions != '') { |
410 | - $receivePromotions = in_array((string)$xml->ReceivePromotions, ['true','1'], true); |
|
410 | + $receivePromotions = in_array((string) $xml->ReceivePromotions, ['true', '1'], true); |
|
411 | 411 | $customer->setReceivePromotions($receivePromotions); |
412 | 412 | } |
413 | 413 | if (isset($xml->actived) && $xml->actived != '') { |
414 | - $activated = in_array((string)$xml->actived, ['true','1'], true); |
|
414 | + $activated = in_array((string) $xml->actived, ['true', '1'], true); |
|
415 | 415 | $customer->setActivated($activated); |
416 | 416 | } |
417 | 417 | if (isset($xml->Title) && $xml->Title != '') { |
@@ -15,7 +15,7 @@ |
||
15 | 15 | public function getHeaders(): array |
16 | 16 | { |
17 | 17 | return [ |
18 | - 'Accept: application/vnd.bpost.shm-productConfiguration-' . ApiVersions::V3_1 . '+XML', |
|
18 | + 'Accept: application/vnd.bpost.shm-productConfiguration-'.ApiVersions::V3_1.'+XML', |
|
19 | 19 | ]; |
20 | 20 | } |
21 | 21 |
@@ -45,13 +45,13 @@ |
||
45 | 45 | public function getHeaders(): array |
46 | 46 | { |
47 | 47 | return [ |
48 | - 'Content-Type: application/vnd.bpost.shm-orderUpdate-' . ApiVersions::V3 . '+XML', |
|
48 | + 'Content-Type: application/vnd.bpost.shm-orderUpdate-'.ApiVersions::V3.'+XML', |
|
49 | 49 | ]; |
50 | 50 | } |
51 | 51 | |
52 | 52 | public function getUrl(): string |
53 | 53 | { |
54 | - return '/orders/' . $this->reference; |
|
54 | + return '/orders/'.$this->reference; |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | public function isExpectXml(): bool |