Passed
Push — master ( 471523...a46036 )
by Arthur
13:15
created
src/Foundation/Abstracts/Transformers/Transformer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,9 +17,9 @@  discard block
 block discarded – undo
17 17
 {
18 18
     use IncludesRelations;
19 19
 
20
-    public $include = [];
20
+    public $include = [ ];
21 21
 
22
-    public $available = [];
22
+    public $available = [ ];
23 23
 
24 24
     public function __construct($resource)
25 25
     {
@@ -57,6 +57,6 @@  discard block
 block discarded – undo
57 57
 
58 58
     public function transformResource()
59 59
     {
60
-        return [];
60
+        return [ ];
61 61
     }
62 62
 }
Please login to merge, or discard this patch.
src/Foundation/Abstracts/Transformers/IncludesRelations.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
             return explode(',', $request->include);
28 28
         }
29 29
 
30
-        return [];
30
+        return [ ];
31 31
     }
32 32
 
33 33
     /**
@@ -36,10 +36,10 @@  discard block
 block discarded – undo
36 36
     public function compileRelations()
37 37
     {
38 38
         $requestedRelations = $this->parseRequestIncludeParameter();
39
-        $relations = [];
39
+        $relations = [ ];
40 40
         foreach ($requestedRelations as $requestedRelation) {
41
-            if (isset($this->available[$requestedRelation])) {
42
-                $relations[$requestedRelation] = $this->available[$requestedRelation];
41
+            if (isset($this->available[ $requestedRelation ])) {
42
+                $relations[ $requestedRelation ] = $this->available[ $requestedRelation ];
43 43
             }
44 44
         }
45 45
         $merge = array_merge($this->include, $relations);
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         if (is_array($relation)) {
57 57
             $this->include = array_merge($this->include, $relation);
58 58
         } else {
59
-            $this->include[] = $relation;
59
+            $this->include[ ] = $relation;
60 60
         }
61 61
 
62 62
         return $this;
@@ -64,18 +64,18 @@  discard block
 block discarded – undo
64 64
 
65 65
     protected function includeRelations()
66 66
     {
67
-        $relations = [];
67
+        $relations = [ ];
68 68
         if ($this->resource instanceof Model) {
69 69
             $relations = $this->compileRelations();
70 70
             foreach ($relations as $relation => $transformer) {
71
-                $relationMethodName = 'transform' . ucfirst(strtolower($relation));
71
+                $relationMethodName = 'transform'.ucfirst(strtolower($relation));
72 72
                 if (method_exists($this, $relationMethodName)) {
73
-                    $relations[$relation] = $this->$relationMethodName($this->resource->$relation);
73
+                    $relations[ $relation ] = $this->$relationMethodName($this->resource->$relation);
74 74
                 } else {
75 75
                     if ($this->resource->$relation instanceof Model) {
76
-                        $relations[$relation] = $transformer::resource($this->whenLoaded($relation));
76
+                        $relations[ $relation ] = $transformer::resource($this->whenLoaded($relation));
77 77
                     } else if ($this->resource->$relation instanceof Collection) {
78
-                        $relations[$relation] = $transformer::collection($this->whenLoaded($relation));
78
+                        $relations[ $relation ] = $transformer::collection($this->whenLoaded($relation));
79 79
                     }
80 80
                 }
81 81
 
Please login to merge, or discard this patch.