Passed
Push — main ( 1c04ad...0d4eee )
by Fernando
06:08 queued 03:49
created
src/Enums/Environment.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,12 +17,12 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Resources/Shipment/Volume.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Resources/Shipment/Calculator.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Resources/Shipment/Product.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Resources/Base.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
examples/packages/example1.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.