Passed
Pull Request — master (#218)
by
unknown
02:34
created
src/Drivers/Jibit/JibitClient.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
      */
94 94
     public function getOrderById($id)
95 95
     {
96
-        return  $this->callCurl('/purchases?purchaseId=' . $id, [], true, 0, 'GET');
96
+        return  $this->callCurl('/purchases?purchaseId='.$id, [], true, 0, 'GET');
97 97
     }
98 98
 
99 99
     /**
@@ -136,10 +136,10 @@  discard block
 block discarded – undo
136 136
         }
137 137
 
138 138
         if (!empty($result['accessToken'])) {
139
-            $this->cache->store('accessToken', 'Bearer ' . $result['accessToken'], 24 * 60 * 60 - 60);
139
+            $this->cache->store('accessToken', 'Bearer '.$result['accessToken'], 24 * 60 * 60 - 60);
140 140
             $this->cache->store('refreshToken', $result['refreshToken'], 48 * 60 * 60 - 60);
141 141
 
142
-            $this->setAccessToken('Bearer ' . $result['accessToken']);
142
+            $this->setAccessToken('Bearer '.$result['accessToken']);
143 143
             $this->setRefreshToken($result['refreshToken']);
144 144
 
145 145
             return 'ok';
@@ -169,15 +169,15 @@  discard block
 block discarded – undo
169 169
             $accessToken = $this->getAccessToken();
170 170
         }
171 171
 
172
-        $ch = curl_init($this->baseUrl . $url);
172
+        $ch = curl_init($this->baseUrl.$url);
173 173
         curl_setopt($ch, CURLOPT_USERAGENT, 'Jibit.class Rest Api');
174 174
         curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
175 175
         curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);
176 176
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
177 177
         curl_setopt($ch, CURLOPT_HTTPHEADER, [
178 178
             'Content-Type: application/json',
179
-            'Authorization: ' . $accessToken,
180
-            'Content-Length: ' . strlen($jsonData)
179
+            'Authorization: '.$accessToken,
180
+            'Content-Length: '.strlen($jsonData)
181 181
         ]);
182 182
 
183 183
         $result = curl_exec($ch);
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
         curl_close($ch);
187 187
 
188 188
         if ($err) {
189
-            throw new PurchaseFailedException('cURL Error #:' . $err);
189
+            throw new PurchaseFailedException('cURL Error #:'.$err);
190 190
         }
191 191
 
192 192
         if (empty($result['errors'])) {
@@ -255,11 +255,11 @@  discard block
 block discarded – undo
255 255
             throw new PurchaseFailedException('Token generation encoutered an error.');
256 256
         }
257 257
 
258
-        if (! empty($result['accessToken'])) {
259
-            $this->cache->store('accessToken', 'Bearer ' . $result['accessToken'], 24 * 60 * 60 - 60);
258
+        if (!empty($result['accessToken'])) {
259
+            $this->cache->store('accessToken', 'Bearer '.$result['accessToken'], 24 * 60 * 60 - 60);
260 260
             $this->cache->store('refreshToken', $result['refreshToken'], 48 * 60 * 60 - 60);
261 261
 
262
-            $this->setAccessToken('Bearer ' . $result['accessToken']);
262
+            $this->setAccessToken('Bearer '.$result['accessToken']);
263 263
             $this->setRefreshToken($result['refreshToken']);
264 264
 
265 265
             return 'ok';
@@ -280,6 +280,6 @@  discard block
 block discarded – undo
280 280
         $this->generateToken();
281 281
         $data = [];
282 282
 
283
-        return $this->callCurl('/purchases/' . $purchaseId . '/verify', $data, true, 0, 'GET');
283
+        return $this->callCurl('/purchases/'.$purchaseId.'/verify', $data, true, 0, 'GET');
284 284
     }
285 285
 }
Please login to merge, or discard this patch.