@@ -17,12 +17,12 @@ |
||
| 17 | 17 | * Production environment |
| 18 | 18 | * @var string |
| 19 | 19 | */ |
| 20 | - const PRODUCTION ='production'; |
|
| 20 | + const PRODUCTION = 'production'; |
|
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * Sandbox environment |
| 24 | 24 | * @var string |
| 25 | 25 | */ |
| 26 | - const SANDBOX ='sandbox'; |
|
| 26 | + const SANDBOX = 'sandbox'; |
|
| 27 | 27 | } |
| 28 | 28 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | */ |
| 107 | 107 | protected function validateNumericArgument($number, $argument) |
| 108 | 108 | { |
| 109 | - if (! Number::isPositive($number)) { |
|
| 109 | + if (!Number::isPositive($number)) { |
|
| 110 | 110 | throw new InvalidArgumentException($argument); |
| 111 | 111 | } |
| 112 | 112 | } |
@@ -116,9 +116,9 @@ discard block |
||
| 116 | 116 | */ |
| 117 | 117 | public function isValid() |
| 118 | 118 | { |
| 119 | - return ! empty($this->getHeight()) |
|
| 120 | - && ! empty($this->getWidth()) |
|
| 121 | - && ! empty($this->getLength()) |
|
| 122 | - && ! empty($this->getWeight()); |
|
| 119 | + return !empty($this->getHeight()) |
|
| 120 | + && !empty($this->getWidth()) |
|
| 121 | + && !empty($this->getLength()) |
|
| 122 | + && !empty($this->getWeight()); |
|
| 123 | 123 | } |
| 124 | 124 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function __construct($resource) |
| 33 | 33 | { |
| 34 | - if (! $resource instanceof Resource) { |
|
| 34 | + if (!$resource instanceof Resource) { |
|
| 35 | 35 | throw new InvalidResourceException; |
| 36 | 36 | } |
| 37 | 37 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | protected function addPostalCodeInPayload($key, $postalCode) |
| 75 | 75 | { |
| 76 | - if (! $this->isValidPostalCode($postalCode)) { |
|
| 76 | + if (!$this->isValidPostalCode($postalCode)) { |
|
| 77 | 77 | throw new InvalidArgumentException($key); |
| 78 | 78 | } |
| 79 | 79 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | public function addPackage($package) |
| 114 | 114 | { |
| 115 | - if (! $this->isValidPackage($package)) { |
|
| 115 | + if (!$this->isValidPackage($package)) { |
|
| 116 | 116 | throw new InvalidVolumeException('package'); |
| 117 | 117 | } |
| 118 | 118 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | public function addProduct($product) |
| 127 | 127 | { |
| 128 | - if (! $this->isValidProduct($product)) { |
|
| 128 | + if (!$this->isValidProduct($product)) { |
|
| 129 | 129 | throw new InvalidVolumeException('product'); |
| 130 | 130 | } |
| 131 | 131 | |
@@ -151,11 +151,11 @@ discard block |
||
| 151 | 151 | */ |
| 152 | 152 | public function addService($service) |
| 153 | 153 | { |
| 154 | - if (! $this->isValidService($service)) { |
|
| 154 | + if (!$this->isValidService($service)) { |
|
| 155 | 155 | throw new InvalidArgumentException('service'); |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | - if (! isset($this->payload['services'])) { |
|
| 158 | + if (!isset($this->payload['services'])) { |
|
| 159 | 159 | $this->payload['services'] = $service; |
| 160 | 160 | } else { |
| 161 | 161 | $this->payload['services'] .= ',' . $service; |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | */ |
| 170 | 170 | public function setReceipt($receipt = true) |
| 171 | 171 | { |
| 172 | - if (! is_bool($receipt)) { |
|
| 172 | + if (!is_bool($receipt)) { |
|
| 173 | 173 | throw new InvalidArgumentException('receipt'); |
| 174 | 174 | } |
| 175 | 175 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | */ |
| 184 | 184 | public function setOwnHand($ownHand = true) |
| 185 | 185 | { |
| 186 | - if (! is_bool($ownHand)) { |
|
| 186 | + if (!is_bool($ownHand)) { |
|
| 187 | 187 | throw new InvalidArgumentException('own_hand'); |
| 188 | 188 | } |
| 189 | 189 | |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | */ |
| 198 | 198 | public function setCollect($collect = true) |
| 199 | 199 | { |
| 200 | - if (! is_bool($collect)) { |
|
| 200 | + if (!is_bool($collect)) { |
|
| 201 | 201 | throw new InvalidArgumentException('collect'); |
| 202 | 202 | } |
| 203 | 203 | |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | throw new InvalidCalculatorPayloadException('There are no defined products or volumes.'); |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | - if (! empty($this->payload['volumes']) && ! empty($this->payload['products'])) { |
|
| 257 | + if (!empty($this->payload['volumes']) && !empty($this->payload['products'])) { |
|
| 258 | 258 | throw new InvalidCalculatorPayloadException('Products and volumes cannot be defined together in the same payload.'); |
| 259 | 259 | } |
| 260 | 260 | } |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | */ |
| 78 | 78 | public function setQuantity($quantity) |
| 79 | 79 | { |
| 80 | - if (! Number::isPositiveInteger($quantity)) { |
|
| 80 | + if (!Number::isPositiveInteger($quantity)) { |
|
| 81 | 81 | throw new InvalidArgumentException("quantity"); |
| 82 | 82 | } |
| 83 | 83 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | public function setEnvironment($environment) |
| 61 | 61 | { |
| 62 | - if (! in_array($environment, Environment::ENVIRONMENTS)) { |
|
| 62 | + if (!in_array($environment, Environment::ENVIRONMENTS)) { |
|
| 63 | 63 | throw new InvalidEnvironmentException; |
| 64 | 64 | } |
| 65 | 65 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | */ |
| 84 | 84 | public function setHttp($http) |
| 85 | 85 | { |
| 86 | - if (! $http instanceof ClientInterface) { |
|
| 86 | + if (!$http instanceof ClientInterface) { |
|
| 87 | 87 | throw new Exception('The parameter passed is not an instance of ' . ClientInterface::class); |
| 88 | 88 | } |
| 89 | 89 | |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | ); |
| 34 | 34 | |
| 35 | 35 | $quotations = $calculator->calculate(); |
| 36 | -}catch (Exception $exception) { |
|
| 36 | +} catch (Exception $exception) { |
|
| 37 | 37 | //Proper exception context |
| 38 | 38 | } |
| 39 | 39 | |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | ); |
| 34 | 34 | |
| 35 | 35 | $quotations = $calculator->calculate(); |
| 36 | -}catch (Exception $exception) { |
|
| 36 | +} catch (Exception $exception) { |
|
| 37 | 37 | //Proper exception context |
| 38 | 38 | } |
| 39 | 39 | |