@@ -80,10 +80,10 @@ discard block |
||
80 | 80 | private function doCall($url, $body = null, $method = 'GET') |
81 | 81 | { |
82 | 82 | // build Authorization header |
83 | - $headers[] = 'Authorization: Basic ' . $this->getAuthorizationHeader(); |
|
83 | + $headers[] = 'Authorization: Basic '.$this->getAuthorizationHeader(); |
|
84 | 84 | |
85 | 85 | // set options |
86 | - $options[CURLOPT_URL] = self::API_URL . $url; |
|
86 | + $options[CURLOPT_URL] = self::API_URL.$url; |
|
87 | 87 | $options[CURLOPT_USERAGENT] = $this->getUserAgent(); |
88 | 88 | $options[CURLOPT_RETURNTRANSFER] = true; |
89 | 89 | $options[CURLOPT_TIMEOUT] = (int) $this->getTimeOut(); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | */ |
157 | 157 | private function getAuthorizationHeader() |
158 | 158 | { |
159 | - return base64_encode($this->accountId . ':' . $this->passPhrase); |
|
159 | + return base64_encode($this->accountId.':'.$this->passPhrase); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | /** |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | */ |
190 | 190 | public function getUserAgent() |
191 | 191 | { |
192 | - return (string) 'PHP Bpost Bpack247/' . self::VERSION . ' ' . $this->userAgent; |
|
192 | + return (string) 'PHP Bpost Bpack247/'.self::VERSION.' '.$this->userAgent; |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | /** |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | public function getMember($id) |
262 | 262 | { |
263 | 263 | $xml = $this->doCall( |
264 | - '/customer/' . $id |
|
264 | + '/customer/'.$id |
|
265 | 265 | ); |
266 | 266 | |
267 | 267 | return Customer::createFromXML($xml); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | { |
76 | 76 | $tagName = 'orderLine'; |
77 | 77 | if ($prefix !== null) { |
78 | - $tagName = $prefix . ':' . $tagName; |
|
78 | + $tagName = $prefix.':'.$tagName; |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | $line = $document->createElement($tagName); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | if ($this->getText() !== null) { |
84 | 84 | $tagName = 'text'; |
85 | 85 | if ($prefix !== null) { |
86 | - $tagName = $prefix . ':' . $tagName; |
|
86 | + $tagName = $prefix.':'.$tagName; |
|
87 | 87 | } |
88 | 88 | $line->appendChild( |
89 | 89 | $document->createElement( |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | if ($this->getNumberOfItems() !== null) { |
96 | 96 | $tagName = 'nbOfItems'; |
97 | 97 | if ($prefix !== null) { |
98 | - $tagName = $prefix . ':' . $tagName; |
|
98 | + $tagName = $prefix.':'.$tagName; |
|
99 | 99 | } |
100 | 100 | $line->appendChild( |
101 | 101 | $document->createElement( |
@@ -138,7 +138,7 @@ |
||
138 | 138 | { |
139 | 139 | $tagName = static::TAG_NAME; |
140 | 140 | if ($prefix !== null) { |
141 | - $tagName = $prefix . ':' . $tagName; |
|
141 | + $tagName = $prefix.':'.$tagName; |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | $customer = $document->createElement($tagName); |
@@ -138,7 +138,7 @@ |
||
138 | 138 | { |
139 | 139 | $tagName = static::TAG_NAME; |
140 | 140 | if ($prefix !== null) { |
141 | - $tagName = $prefix . ':' . $tagName; |
|
141 | + $tagName = $prefix.':'.$tagName; |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | $customer = $document->createElement($tagName); |
@@ -58,7 +58,7 @@ |
||
58 | 58 | |
59 | 59 | foreach ($keysToHash as $key) { |
60 | 60 | if (isset($this->parameters[$key])) { |
61 | - if (! is_array($this->parameters[$key])) { |
|
61 | + if (! is_array($this->parameters[$key])) { |
|
62 | 62 | $base .= $key.'='.$this->parameters[$key].'&'; |
63 | 63 | } else { |
64 | 64 | foreach ($this->parameters[$key] as $entry) { |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | 'orderReference', |
55 | 55 | 'orderWeight', |
56 | 56 | ); |
57 | - $base = 'accountId=' . $this->bpost->getAccountId() . '&'; |
|
57 | + $base = 'accountId='.$this->bpost->getAccountId().'&'; |
|
58 | 58 | |
59 | 59 | foreach ($keysToHash as $key) { |
60 | 60 | if (isset($this->parameters[$key])) { |
61 | - if (! is_array($this->parameters[$key])) { |
|
61 | + if (!is_array($this->parameters[$key])) { |
|
62 | 62 | $base .= $key.'='.$this->parameters[$key].'&'; |
63 | 63 | } else { |
64 | 64 | foreach ($this->parameters[$key] as $entry) { |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | |
89 | 89 | if ($form && isset($return['orderLine'])) { |
90 | 90 | foreach ($return['orderLine'] as $key => $value) { |
91 | - $return['orderLine[' . $key . ']'] = $value; |
|
91 | + $return['orderLine['.$key.']'] = $value; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | unset($return['orderLine']); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | public function setBarcode($barcode) |
28 | 28 | { |
29 | - $this->barcode = (string)$barcode; |
|
29 | + $this->barcode = (string) $barcode; |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
@@ -62,10 +62,10 @@ discard block |
||
62 | 62 | { |
63 | 63 | $self = new self(); |
64 | 64 | if (isset($xml->barcode) && $xml->barcode != '') { |
65 | - $self->setBarcode((string)$xml->barcode); |
|
65 | + $self->setBarcode((string) $xml->barcode); |
|
66 | 66 | } |
67 | 67 | if (isset($xml->reference) && $xml->reference != '') { |
68 | - $self->setReference((string)$xml->reference); |
|
68 | + $self->setReference((string) $xml->reference); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | return $self; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | } |
101 | 101 | |
102 | 102 | /** |
103 | - * @return array |
|
103 | + * @return string[] |
|
104 | 104 | */ |
105 | 105 | public static function getPossibleParcelReturnInstructionValues() |
106 | 106 | { |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | } |
168 | 168 | |
169 | 169 | /** |
170 | - * @return array |
|
170 | + * @return string[] |
|
171 | 171 | */ |
172 | 172 | public static function getPossibleShipmentTypeValues() |
173 | 173 | { |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | { |
192 | 192 | $tagName = 'customsInfo'; |
193 | 193 | if ($prefix !== null) { |
194 | - $tagName = $prefix . ':' . $tagName; |
|
194 | + $tagName = $prefix.':'.$tagName; |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | $customsInfo = $document->createElement($tagName); |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | if ($this->getParcelValue() !== null) { |
200 | 200 | $tagName = 'parcelValue'; |
201 | 201 | if ($prefix !== null) { |
202 | - $tagName = $prefix . ':' . $tagName; |
|
202 | + $tagName = $prefix.':'.$tagName; |
|
203 | 203 | } |
204 | 204 | $customsInfo->appendChild( |
205 | 205 | $document->createElement( |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | if ($this->getContentDescription() !== null) { |
212 | 212 | $tagName = 'contentDescription'; |
213 | 213 | if ($prefix !== null) { |
214 | - $tagName = $prefix . ':' . $tagName; |
|
214 | + $tagName = $prefix.':'.$tagName; |
|
215 | 215 | } |
216 | 216 | $customsInfo->appendChild( |
217 | 217 | $document->createElement( |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | if ($this->getShipmentType() !== null) { |
224 | 224 | $tagName = 'shipmentType'; |
225 | 225 | if ($prefix !== null) { |
226 | - $tagName = $prefix . ':' . $tagName; |
|
226 | + $tagName = $prefix.':'.$tagName; |
|
227 | 227 | } |
228 | 228 | $customsInfo->appendChild( |
229 | 229 | $document->createElement( |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | if ($this->getPossibleParcelReturnInstructionValues() !== null) { |
236 | 236 | $tagName = 'parcelReturnInstructions'; |
237 | 237 | if ($prefix !== null) { |
238 | - $tagName = $prefix . ':' . $tagName; |
|
238 | + $tagName = $prefix.':'.$tagName; |
|
239 | 239 | } |
240 | 240 | $customsInfo->appendChild( |
241 | 241 | $document->createElement( |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | if ($this->getPrivateAddress() !== null) { |
248 | 248 | $tagName = 'privateAddress'; |
249 | 249 | if ($prefix !== null) { |
250 | - $tagName = $prefix . ':' . $tagName; |
|
250 | + $tagName = $prefix.':'.$tagName; |
|
251 | 251 | } |
252 | 252 | if ($this->getPrivateAddress()) { |
253 | 253 | $value = 'true'; |
@@ -173,7 +173,7 @@ |
||
173 | 173 | } |
174 | 174 | |
175 | 175 | /** |
176 | - * @return array |
|
176 | + * @return string[] |
|
177 | 177 | */ |
178 | 178 | public static function getPossibleStatusValues() |
179 | 179 | { |
@@ -138,7 +138,7 @@ |
||
138 | 138 | { |
139 | 139 | $tagName = static::TAG_NAME; |
140 | 140 | if ($prefix !== null) { |
141 | - $tagName = $prefix . ':' . $tagName; |
|
141 | + $tagName = $prefix.':'.$tagName; |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | $customer = $document->createElement($tagName); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | */ |
133 | 133 | public function setProduct($product) |
134 | 134 | { |
135 | - if ( ! in_array($product, self::getPossibleProductValues())) { |
|
135 | + if (!in_array($product, self::getPossibleProductValues())) { |
|
136 | 136 | throw new BpostInvalidValueException('product', $product, self::getPossibleProductValues()); |
137 | 137 | } |
138 | 138 | |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | */ |
196 | 196 | public function setRequestedDeliveryDate($requestedDeliveryDate) |
197 | 197 | { |
198 | - $this->requestedDeliveryDate = (string)$requestedDeliveryDate; |
|
198 | + $this->requestedDeliveryDate = (string) $requestedDeliveryDate; |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | /** |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | { |
212 | 212 | $tagName = 'nationalBox'; |
213 | 213 | if ($prefix !== null) { |
214 | - $tagName = $prefix . ':' . $tagName; |
|
214 | + $tagName = $prefix.':'.$tagName; |
|
215 | 215 | } |
216 | 216 | $nationalElement = $document->createElement($tagName); |
217 | 217 | $boxElement = parent::toXML($document, null, 'at24-7'); |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | |
310 | 310 | if (isset($xml->{'at24-7'}->product) && $xml->{'at24-7'}->product != '') { |
311 | 311 | $at247->setProduct( |
312 | - (string)$xml->{'at24-7'}->product |
|
312 | + (string) $xml->{'at24-7'}->product |
|
313 | 313 | ); |
314 | 314 | } |
315 | 315 | if (isset($xml->{'at24-7'}->options)) { |
@@ -320,8 +320,8 @@ discard block |
||
320 | 320 | if (in_array($optionData->getName(), array(Messaging::MESSAGING_TYPE_INFO_DISTRIBUTED))) { |
321 | 321 | $option = Messaging::createFromXML($optionData); |
322 | 322 | } else { |
323 | - $className = '\\Bpost\\BpostApiClient\\Bpost\\Order\\Box\\Option\\' . ucfirst($optionData->getName()); |
|
324 | - if ( ! method_exists($className, 'createFromXML')) { |
|
323 | + $className = '\\Bpost\\BpostApiClient\\Bpost\\Order\\Box\\Option\\'.ucfirst($optionData->getName()); |
|
324 | + if (!method_exists($className, 'createFromXML')) { |
|
325 | 325 | throw new BpostNotImplementedException(); |
326 | 326 | } |
327 | 327 | $option = call_user_func( |
@@ -335,32 +335,32 @@ discard block |
||
335 | 335 | } |
336 | 336 | if (isset($xml->{'at24-7'}->weight) && $xml->{'at24-7'}->weight != '') { |
337 | 337 | $at247->setWeight( |
338 | - (int)$xml->{'at24-7'}->weight |
|
338 | + (int) $xml->{'at24-7'}->weight |
|
339 | 339 | ); |
340 | 340 | } |
341 | 341 | if (isset($xml->{'at24-7'}->memberId) && $xml->{'at24-7'}->memberId != '') { |
342 | 342 | $at247->setMemberId( |
343 | - (string)$xml->{'at24-7'}->memberId |
|
343 | + (string) $xml->{'at24-7'}->memberId |
|
344 | 344 | ); |
345 | 345 | } |
346 | 346 | if (isset($xml->{'at24-7'}->receiverName) && $xml->{'at24-7'}->receiverName != '') { |
347 | 347 | $at247->setReceiverName( |
348 | - (string)$xml->{'at24-7'}->receiverName |
|
348 | + (string) $xml->{'at24-7'}->receiverName |
|
349 | 349 | ); |
350 | 350 | } |
351 | 351 | if (isset($xml->{'at24-7'}->receiverCompany) && $xml->{'at24-7'}->receiverCompany != '') { |
352 | 352 | $at247->setReceiverCompany( |
353 | - (string)$xml->{'at24-7'}->receiverCompany |
|
353 | + (string) $xml->{'at24-7'}->receiverCompany |
|
354 | 354 | ); |
355 | 355 | } |
356 | 356 | if (isset($xml->{'at24-7'}->parcelsDepotId) && $xml->{'at24-7'}->parcelsDepotId != '') { |
357 | 357 | $at247->setParcelsDepotId( |
358 | - (string)$xml->{'at24-7'}->parcelsDepotId |
|
358 | + (string) $xml->{'at24-7'}->parcelsDepotId |
|
359 | 359 | ); |
360 | 360 | } |
361 | 361 | if (isset($xml->{'at24-7'}->parcelsDepotName) && $xml->{'at24-7'}->parcelsDepotName != '') { |
362 | 362 | $at247->setParcelsDepotName( |
363 | - (string)$xml->{'at24-7'}->parcelsDepotName |
|
363 | + (string) $xml->{'at24-7'}->parcelsDepotName |
|
364 | 364 | ); |
365 | 365 | } |
366 | 366 | if (isset($xml->{'at24-7'}->parcelsDepotAddress)) { |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | } |
375 | 375 | if (isset($xml->{'at24-7'}->requestedDeliveryDate) && $xml->{'at24-7'}->requestedDeliveryDate != '') { |
376 | 376 | $at247->setRequestedDeliveryDate( |
377 | - (string)$xml->{'at24-7'}->requestedDeliveryDate |
|
377 | + (string) $xml->{'at24-7'}->requestedDeliveryDate |
|
378 | 378 | ); |
379 | 379 | } |
380 | 380 |