Passed
Push — main ( d887ef...1164b9 )
by Dylan
02:33
created
src/CurlResponse.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,9 @@
 block discarded – undo
40 40
     public function getJSON(): ?array
41 41
     {
42 42
         $data = json_decode($this->result, true);
43
-        if (!is_array($data)) return null;
43
+        if (!is_array($data)) {
44
+            return null;
45
+        }
44 46
         
45 47
         return $data;
46 48
     }
Please login to merge, or discard this patch.
src/utils/Utils.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
         $randomString = '';
18 18
 
19 19
         for ($i = 0; $i < $length; $i++) {
20
-            $randomString .= $characters[rand(0, $charactersLength - 1)];
20
+            $randomString .= $characters[rand(0, $charactersLength-1)];
21 21
         }
22 22
 
23 23
         return $randomString;
@@ -29,6 +29,6 @@  discard block
 block discarded – undo
29 29
      */
30 30
     public static function pack(string $str): string
31 31
     {
32
-        return rtrim(strtr(base64_encode(pack('H*',  hash('sha256', $str))), '+/', '-_'), '=');
32
+        return rtrim(strtr(base64_encode(pack('H*', hash('sha256', $str))), '+/', '-_'), '=');
33 33
     }
34 34
 }
Please login to merge, or discard this patch.
src/factory/ServiceFactory.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,9 @@
 block discarded – undo
19 19
     public static function inst(Connector $connector, string $service): ?ApiService
20 20
     {
21 21
         $service = strtolower($service);
22
-        if (!array_key_exists($service, ClassMap::SERVICES)) return null;
22
+        if (!array_key_exists($service, ClassMap::SERVICES)) {
23
+            return null;
24
+        }
23 25
 
24 26
         $cls = ClassMap::SERVICES[$service];
25 27
         return new $cls($connector);
Please login to merge, or discard this patch.
src/services/ApiService.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,9 @@
 block discarded – undo
98 98
     {
99 99
         $curl = $this->getClient()->curl_api($url, 'DELETE', $params);
100 100
 
101
-        if ($curl->isValid()) return true;
101
+        if ($curl->isValid()) {
102
+            return true;
103
+        }
102 104
 
103 105
         throw new ApiException($curl->getError());
104 106
     }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
         if ($curl->isValid()) {
78 78
             if ($curl->isJSON()) {
79 79
                 return ObjectFactory::make($this->getClient(), $curl->getJSON());
80
-            } else {
80
+            }else {
81 81
                 return true;
82 82
             }
83 83
         }
Please login to merge, or discard this patch.
src/services/Customers.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     public function fetch(int $id): ?Customer
24 24
     {
25 25
         /** @var Customer|null $fetch */
26
-        $fetch = $this->_get('api/customers/customer' . $id);
26
+        $fetch = $this->_get('api/customers/customer'.$id);
27 27
         return $fetch;
28 28
     }
29 29
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     public function update(int $id, array $data): ?Customer
51 51
     {
52 52
         /** @var Customer|null $post */
53
-        $post = $this->_post('api/customers/customer/' . $id, $data);
53
+        $post = $this->_post('api/customers/customer/'.$id, $data);
54 54
         return $post;
55 55
     }
56 56
 
Please login to merge, or discard this patch.
src/services/Addresses.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     public function fetch(int $id): ?Address
24 24
     {
25 25
         /** @var Address|null $address */
26
-        $address = $this->_get('api/addresses/address' . $id);
26
+        $address = $this->_get('api/addresses/address'.$id);
27 27
         return $address;
28 28
     }
29 29
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     public function update(int $id, array $data): ?Address
51 51
     {
52 52
         /** @var Address|null $address */
53
-        $address = $this->_post('api/addresses/address/' . $id, $data);
53
+        $address = $this->_post('api/addresses/address/'.$id, $data);
54 54
         return $address;
55 55
     }
56 56
 
Please login to merge, or discard this patch.
src/models/Address.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,9 @@
 block discarded – undo
59 59
      */
60 60
     public function Customer(): ?Customer
61 61
     {
62
-        if (!$this->CustomerID) return null;
62
+        if (!$this->CustomerID) {
63
+            return null;
64
+        }
63 65
 
64 66
         /** @var Customer|null $customer */
65 67
         $customer = $this->getClient()->customers->fetch($this->CustomerID);
Please login to merge, or discard this patch.
src/resource/SimpleList.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
         $t = $this->getItems();
63 63
         $c = $this->count();
64 64
 
65
-        return (function () use ($t, $c) {
65
+        return (function() use ($t, $c) {
66 66
             $i = 0;
67 67
 
68 68
             while ($i < $c) {
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,9 @@  discard block
 block discarded – undo
42 42
 
43 43
             foreach ($list as $item) {
44 44
                 $obj = ObjectFactory::make($this->getClient(), $item);
45
-                if (!$obj) continue;
45
+                if (!$obj) {
46
+                    continue;
47
+                }
46 48
 
47 49
                 $this->_items[] = $obj;
48 50
             }
@@ -76,6 +78,8 @@  discard block
 block discarded – undo
76 78
      */
77 79
     public function first(): ?Model
78 80
     {
79
-        foreach ($this as $obj) return $obj;
81
+        foreach ($this as $obj) {
82
+            return $obj;
83
+        }
80 84
     }
81 85
 }
Please login to merge, or discard this patch.
src/services/CustomPages.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     public function fetch(int $id): ?CustomPage
38 38
     {
39 39
         /** @var CustomPage|null $fetch */
40
-        $fetch = $this->_get('api/pages/page' . $id);
40
+        $fetch = $this->_get('api/pages/page'.$id);
41 41
         return $fetch;
42 42
     }
43 43
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     public function update(int $id, array $data): ?CustomPage
65 65
     {
66 66
         /** @var CustomPage|null $post */
67
-        $post = $this->_post('api/pages/page/' . $id, $data);
67
+        $post = $this->_post('api/pages/page/'.$id, $data);
68 68
         return $post;
69 69
     }
70 70
 
Please login to merge, or discard this patch.