@@ -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'; |
@@ -11,21 +11,24 @@ |
||
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * @param array $options |
| 14 | + * @return void |
|
| 14 | 15 | */ |
| 15 | 16 | public function setOptions($options); |
| 16 | 17 | |
| 17 | 18 | /** |
| 18 | - * @return array |
|
| 19 | + * @return Option\Option[] |
|
| 19 | 20 | */ |
| 20 | 21 | public function getOptions(); |
| 21 | 22 | |
| 22 | 23 | /** |
| 23 | 24 | * @param \Bpost\BpostApiClient\Bpost\Order\Box\Option\Option $option |
| 25 | + * @return void |
|
| 24 | 26 | */ |
| 25 | 27 | public function addOption(Option\Option $option); |
| 26 | 28 | |
| 27 | 29 | /** |
| 28 | 30 | * @param string $product |
| 31 | + * @return void |
|
| 29 | 32 | */ |
| 30 | 33 | public function setProduct($product); |
| 31 | 34 | |
@@ -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); |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | /** |
| 18 | 18 | * Return the object as an array for usage in the XML |
| 19 | 19 | * |
| 20 | - * @param DomDocument $document |
|
| 20 | + * @param DOMDocument $document |
|
| 21 | 21 | * @param string $prefix |
| 22 | 22 | * @return DomElement |
| 23 | 23 | */ |
@@ -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); |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * BasicAttribute constructor. |
| 20 | - * @param mixed $value |
|
| 20 | + * @param string $value |
|
| 21 | 21 | * @param string $key |
| 22 | 22 | */ |
| 23 | 23 | public function __construct($value, $key = '') |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
| 88 | - * @param array $allowedValues |
|
| 88 | + * @param string[] $allowedValues |
|
| 89 | 89 | * @throws BpostInvalidValueException |
| 90 | 90 | */ |
| 91 | 91 | public function validateChoice(array $allowedValues) |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | private function setKey($key) |
| 42 | 42 | { |
| 43 | - $this->key = (string)($key ?: $this->getDefaultKey()); |
|
| 43 | + $this->key = (string) ($key ?: $this->getDefaultKey()); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /** |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | public function __toString() |
| 58 | 58 | { |
| 59 | - return (string)$this->getValue(); |
|
| 59 | + return (string) $this->getValue(); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /** |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | if (empty($prefix)) { |
| 71 | 71 | return $tagName; |
| 72 | 72 | } |
| 73 | - return $prefix . ':' . $tagName; |
|
| 73 | + return $prefix.':'.$tagName; |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | $headers = curl_getinfo($curl); |
| 92 | 92 | |
| 93 | 93 | $this->logger->debug('curl response', array( |
| 94 | - 'status' => $errorNumber . ' (' . $errorMessage . ')', |
|
| 94 | + 'status' => $errorNumber.' ('.$errorMessage.')', |
|
| 95 | 95 | 'headers' => $headers, |
| 96 | 96 | 'response' => $this->responseBody |
| 97 | 97 | )); |
@@ -122,6 +122,6 @@ discard block |
||
| 122 | 122 | */ |
| 123 | 123 | public function getHttpCodeType() |
| 124 | 124 | { |
| 125 | - return 100 * (int)($this->responseHttpCode / 100); |
|
| 125 | + return 100 * (int) ($this->responseHttpCode / 100); |
|
| 126 | 126 | } |
| 127 | 127 | } |
@@ -15,6 +15,6 @@ |
||
| 15 | 15 | if (empty($prefix)) { |
| 16 | 16 | return $tagName; |
| 17 | 17 | } |
| 18 | - return $prefix . ':' . $tagName; |
|
| 18 | + return $prefix.':'.$tagName; |
|
| 19 | 19 | } |
| 20 | 20 | } |
@@ -66,8 +66,8 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | public function __construct($partner, $appId) |
| 68 | 68 | { |
| 69 | - $this->setPartner((string)$partner); |
|
| 70 | - $this->setAppId((string)$appId); |
|
| 69 | + $this->setPartner((string) $partner); |
|
| 70 | + $this->setAppId((string) $appId); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | /** |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | */ |
| 99 | 99 | private function buildUrl($method, array $parameters = array()) |
| 100 | 100 | { |
| 101 | - return self::API_URL . '?' . $this->buildParameters($method, $parameters); |
|
| 101 | + return self::API_URL.'?'.$this->buildParameters($method, $parameters); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | /** |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | CURLOPT_SSL_VERIFYPEER => false, |
| 139 | 139 | CURLOPT_SSL_VERIFYHOST => false, |
| 140 | 140 | CURLOPT_RETURNTRANSFER => true, |
| 141 | - CURLOPT_TIMEOUT => (int)$this->getTimeOut(), |
|
| 141 | + CURLOPT_TIMEOUT => (int) $this->getTimeOut(), |
|
| 142 | 142 | |
| 143 | 143 | CURLOPT_POST => true, |
| 144 | 144 | CURLOPT_POSTFIELDS => $this->buildParameters($method, $parameters), |
@@ -155,8 +155,8 @@ discard block |
||
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | // catch generic errors |
| 158 | - if (isset($xml['type']) && (string)$xml['type'] == 'TaxipostLocatorError') { |
|
| 159 | - throw new BpostTaxipostLocatorException((string)$xml->txt, (int)$xml->status); |
|
| 158 | + if (isset($xml['type']) && (string) $xml['type'] == 'TaxipostLocatorError') { |
|
| 159 | + throw new BpostTaxipostLocatorException((string) $xml->txt, (int) $xml->status); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | // return |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | */ |
| 204 | 204 | public function setTimeOut($seconds) |
| 205 | 205 | { |
| 206 | - $this->timeOut = (int)$seconds; |
|
| 206 | + $this->timeOut = (int) $seconds; |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | /** |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | */ |
| 214 | 214 | public function getTimeOut() |
| 215 | 215 | { |
| 216 | - return (int)$this->timeOut; |
|
| 216 | + return (int) $this->timeOut; |
|
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | /** |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | */ |
| 226 | 226 | public function getUserAgent() |
| 227 | 227 | { |
| 228 | - return (string)'PHP Bpost Geo6/' . self::VERSION . ' ' . $this->userAgent; |
|
| 228 | + return (string) 'PHP Bpost Geo6/'.self::VERSION.' '.$this->userAgent; |
|
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | /** |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | */ |
| 237 | 237 | public function setUserAgent($userAgent) |
| 238 | 238 | { |
| 239 | - $this->userAgent = (string)$userAgent; |
|
| 239 | + $this->userAgent = (string) $userAgent; |
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | // webservice methods |
@@ -262,12 +262,12 @@ discard block |
||
| 262 | 262 | public function getNearestServicePoint($street, $number, $zone, $language = 'nl', $type = 3, $limit = 10) |
| 263 | 263 | { |
| 264 | 264 | $parameters = array( |
| 265 | - 'Street' => (string)$street, |
|
| 266 | - 'Number' => (string)$number, |
|
| 267 | - 'Zone' => (string)$zone, |
|
| 268 | - 'Language' => (string)$language, |
|
| 269 | - 'Type' => (int)$type, |
|
| 270 | - 'Limit' => (int)$limit |
|
| 265 | + 'Street' => (string) $street, |
|
| 266 | + 'Number' => (string) $number, |
|
| 267 | + 'Zone' => (string) $zone, |
|
| 268 | + 'Language' => (string) $language, |
|
| 269 | + 'Type' => (int) $type, |
|
| 270 | + 'Limit' => (int) $limit |
|
| 271 | 271 | ); |
| 272 | 272 | |
| 273 | 273 | $xml = $this->doCall('search', $parameters); |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | foreach ($xml->PoiList->Poi as $poi) { |
| 281 | 281 | $pois[] = array( |
| 282 | 282 | 'poi' => Poi::createFromXML($poi), |
| 283 | - 'distance' => (float)$poi->Distance, |
|
| 283 | + 'distance' => (float) $poi->Distance, |
|
| 284 | 284 | ); |
| 285 | 285 | } |
| 286 | 286 | |
@@ -306,9 +306,9 @@ discard block |
||
| 306 | 306 | public function getServicePointDetails($id, $language = 'nl', $type = 3) |
| 307 | 307 | { |
| 308 | 308 | $parameters = array( |
| 309 | - 'Id' => (string)$id, |
|
| 310 | - 'Language' => (string)$language, |
|
| 311 | - 'Type' => (int)$type, |
|
| 309 | + 'Id' => (string) $id, |
|
| 310 | + 'Language' => (string) $language, |
|
| 311 | + 'Type' => (int) $type, |
|
| 312 | 312 | ); |
| 313 | 313 | |
| 314 | 314 | $xml = $this->doCall('info', $parameters); |
@@ -331,9 +331,9 @@ discard block |
||
| 331 | 331 | public function getServicePointPageUrl($id, $language = 'nl', $type = 3) |
| 332 | 332 | { |
| 333 | 333 | $parameters = array( |
| 334 | - 'Id' => (string)$id, |
|
| 335 | - 'Language' => (string)$language, |
|
| 336 | - 'Type' => (int)$type, |
|
| 334 | + 'Id' => (string) $id, |
|
| 335 | + 'Language' => (string) $language, |
|
| 336 | + 'Type' => (int) $type, |
|
| 337 | 337 | ); |
| 338 | 338 | |
| 339 | 339 | return $this->buildUrl('page', $parameters); |
@@ -101,7 +101,7 @@ |
||
| 101 | 101 | */ |
| 102 | 102 | public function output() |
| 103 | 103 | { |
| 104 | - header('Content-type: ' . $this->getMimeType()); |
|
| 104 | + header('Content-type: '.$this->getMimeType()); |
|
| 105 | 105 | echo $this->getBytes(); |
| 106 | 106 | exit; |
| 107 | 107 | } |