Passed
Push — main ( 383cbf...40aa9a )
by Dylan
02:01
created
src/services/Orders.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
             throw new InvalidArgumentException("{$class}::fetch() expects parameter 1 to be a positive integer");
43 43
         }
44 44
 
45
-        return $this->retrieve('api/orders/order/' . $id);
45
+        return $this->retrieve('api/orders/order/'.$id);
46 46
     }
47 47
 
48 48
     /**
Please login to merge, or discard this patch.
src/Connector.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,9 @@
 block discarded – undo
45 45
     public function __get(string $service): ?ApiService
46 46
     {
47 47
         $obj = ServiceFactory::inst($this, $service);
48
-        if (!$obj) throw new BadMethodException("Service for `{$service}` does not exist");
48
+        if (!$obj) {
49
+            throw new BadMethodException("Service for `{$service}` does not exist");
50
+        }
49 51
 
50 52
         return $obj;
51 53
     }
Please login to merge, or discard this patch.
src/factory/ObjectFactory.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,9 @@  discard block
 block discarded – undo
26 26
     public static function create(Connector $connector, string $model, array $data = []): ?Model
27 27
     {
28 28
         $model = strtolower($model);
29
-        if (!array_key_exists($model, self::CLASS_MAP)) return null;
29
+        if (!array_key_exists($model, self::CLASS_MAP)) {
30
+            return null;
31
+        }
30 32
 
31 33
         $cls = self::CLASS_MAP[$model];
32 34
         return new $cls($connector, $data);
@@ -40,7 +42,9 @@  discard block
 block discarded – undo
40 42
     public static function make(Connector $connector, array $data): ?ObjectResource
41 43
     {
42 44
         $model = $data['model'] ?? '';
43
-        if (!$model) return new ObjectResource($connector, $data);
45
+        if (!$model) {
46
+            return new ObjectResource($connector, $data);
47
+        }
44 48
         return self::create($connector, $model, $data);
45 49
     }
46 50
 }
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
@@ -23,7 +23,9 @@
 block discarded – undo
23 23
     public static function inst(Connector $connector, string $service): ?ApiService
24 24
     {
25 25
         $service = strtolower($service);
26
-        if (!array_key_exists($service, self::CLASS_MAP)) return null;
26
+        if (!array_key_exists($service, self::CLASS_MAP)) {
27
+            return null;
28
+        }
27 29
 
28 30
         $cls = self::CLASS_MAP[$service];
29 31
         return new $cls($connector);
Please login to merge, or discard this patch.
src/models/Order.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,6 +15,6 @@
 block discarded – undo
15 15
      */
16 16
     protected function getSaveURL(): string
17 17
     {
18
-        return 'api/orders/order/' . $this->ID;
18
+        return 'api/orders/order/'.$this->ID;
19 19
     }
20 20
 }
Please login to merge, or discard this patch.
src/models/Model.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
                     // Model or Object
39 39
                     if (!array_key_exists('field_name', $value)) {
40 40
                         $this->$field = ObjectFactory::make($client, $value);
41
-                    } else {
41
+                    }else {
42 42
                         // Has One Relation - Deprecated
43 43
                         $name = $value['field_name'];
44 44
                         $this->$name    = $value['field_value'];
@@ -49,20 +49,20 @@  discard block
 block discarded – undo
49 49
                     if (!property_exists($this->$field, $model)) {
50 50
                         $this->$field->$model = $this;
51 51
                     }
52
-                } else {
52
+                }else {
53 53
                     // HasMany / ManyMany Relation
54 54
                     $list = [];
55 55
                     foreach ($value as $item) {
56 56
                         if (ArrayLib::is_associative($item)) {
57 57
                             $list = ObjectFactory::make($client, $item);
58
-                        } else {
58
+                        }else {
59 59
                             $list = $item;
60 60
                         }
61 61
                     }
62 62
 
63 63
                     $this->$field = $list;
64 64
                 }
65
-            } else {
65
+            }else {
66 66
                 $this->$field = $value;
67 67
             }
68 68
         }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,9 @@
 block discarded – undo
29 29
             throw new InvalidArgumentException("Model::__construct() expects an associative array");
30 30
         }
31 31
 
32
-        if (array_key_exists('model', $_object_data)) $this->model = $_object_data['model'];
32
+        if (array_key_exists('model', $_object_data)) {
33
+            $this->model = $_object_data['model'];
34
+        }
33 35
         $model = $this->model;
34 36
 
35 37
         foreach ($_object_data as $field => $value) {
Please login to merge, or discard this patch.