@@ -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 | |
@@ -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 | } |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | { |
| 162 | 162 | $tagName = 'internationalBox'; |
| 163 | 163 | if ($prefix !== null) { |
| 164 | - $tagName = $prefix . ':' . $tagName; |
|
| 164 | + $tagName = $prefix.':'.$tagName; |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | $internationalBox = $document->createElement($tagName); |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | if (in_array($optionData->getName(), array(Messaging::MESSAGING_TYPE_INFO_DISTRIBUTED))) { |
| 237 | 237 | $option = Messaging::createFromXML($optionData); |
| 238 | 238 | } else { |
| 239 | - $className = '\\Bpost\\BpostApiClient\\Bpost\\Order\\Box\\Option\\' . ucfirst($optionData->getName()); |
|
| 239 | + $className = '\\Bpost\\BpostApiClient\\Bpost\\Order\\Box\\Option\\'.ucfirst($optionData->getName()); |
|
| 240 | 240 | if (!method_exists($className, 'createFromXML')) { |
| 241 | 241 | throw new BpostNotImplementedException(); |
| 242 | 242 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | { |
| 98 | 98 | $tagName = 'cod'; |
| 99 | 99 | if ($prefix !== null) { |
| 100 | - $tagName = $prefix . ':' . $tagName; |
|
| 100 | + $tagName = $prefix.':'.$tagName; |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | $cod = $document->createElement($tagName); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | if ($this->getAmount() !== null) { |
| 106 | 106 | $tagName = 'codAmount'; |
| 107 | 107 | if ($prefix !== null) { |
| 108 | - $tagName = $prefix . ':' . $tagName; |
|
| 108 | + $tagName = $prefix.':'.$tagName; |
|
| 109 | 109 | } |
| 110 | 110 | $cod->appendChild( |
| 111 | 111 | $document->createElement( |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | if ($this->getIban() !== null) { |
| 118 | 118 | $tagName = 'iban'; |
| 119 | 119 | if ($prefix !== null) { |
| 120 | - $tagName = $prefix . ':' . $tagName; |
|
| 120 | + $tagName = $prefix.':'.$tagName; |
|
| 121 | 121 | } |
| 122 | 122 | $cod->appendChild( |
| 123 | 123 | $document->createElement( |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | if ($this->getBic() !== null) { |
| 130 | 130 | $tagName = 'bic'; |
| 131 | 131 | if ($prefix !== null) { |
| 132 | - $tagName = $prefix . ':' . $tagName; |
|
| 132 | + $tagName = $prefix.':'.$tagName; |
|
| 133 | 133 | } |
| 134 | 134 | $cod->appendChild( |
| 135 | 135 | $document->createElement( |