Passed
Push — master ( 34097c...d55670 )
by pooya
02:44
created
src/BinanceAPI.php 1 patch
Braces   +18 added lines, -12 removed lines patch added patch discarded remove patch
@@ -102,14 +102,16 @@  discard block
 block discarded – undo
102 102
 
103 103
         //Get result
104 104
         $result = curl_exec($this->curl);
105
-        if ($result === false)
106
-            throw new Exception('CURL error: ' . curl_error($this->curl));
105
+        if ($result === false) {
106
+                    throw new Exception('CURL error: ' . curl_error($this->curl));
107
+        }
107 108
 
108 109
         // decode results
109 110
         $result = json_decode($result, true);
110 111
 
111
-        if (!is_array($result) || json_last_error())
112
-            throw new Exception('JSON decode error');
112
+        if (!is_array($result) || json_last_error()) {
113
+                    throw new Exception('JSON decode error');
114
+        }
113 115
 
114 116
         return $result;
115 117
 
@@ -230,13 +232,15 @@  discard block
 block discarded – undo
230 232
 
231 233
         //Get result
232 234
         $result = curl_exec($this->curl);
233
-        if ($result === false)
234
-            throw new Exception('CURL error: ' . curl_error($this->curl));
235
+        if ($result === false) {
236
+                    throw new Exception('CURL error: ' . curl_error($this->curl));
237
+        }
235 238
 
236 239
         // decode results
237 240
         $result = json_decode($result, true);
238
-        if (!is_array($result) || json_last_error())
239
-            throw new Exception('JSON decode error');
241
+        if (!is_array($result) || json_last_error()) {
242
+                    throw new Exception('JSON decode error');
243
+        }
240 244
 
241 245
         return $result;
242 246
 
@@ -414,13 +418,15 @@  discard block
 block discarded – undo
414 418
 
415 419
         //Get result
416 420
         $result = curl_exec($this->curl);
417
-        if ($result === false)
418
-            throw new Exception('CURL error: ' . curl_error($this->curl));
421
+        if ($result === false) {
422
+                    throw new Exception('CURL error: ' . curl_error($this->curl));
423
+        }
419 424
 
420 425
         // decode results
421 426
         $result = json_decode($result, true);
422
-        if (!is_array($result) || json_last_error())
423
-            throw new Exception('JSON decode error');
427
+        if (!is_array($result) || json_last_error()) {
428
+                    throw new Exception('JSON decode error');
429
+        }
424 430
 
425 431
         return $result;
426 432
 
Please login to merge, or discard this patch.