Passed
Push — master ( 774737...66725d )
by Arthur
21:05
created
src/Foundation/Abstracts/Transformers/IncludesRelations.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
             return explode(',', $request->include);
27 27
         }
28 28
 
29
-        return [];
29
+        return [ ];
30 30
     }
31 31
 
32 32
     /**
@@ -35,10 +35,10 @@  discard block
 block discarded – undo
35 35
     public function compileRelations()
36 36
     {
37 37
         $requestedRelations = $this->parseRequestIncludeParameter();
38
-        $relations = [];
38
+        $relations = [ ];
39 39
         foreach ($requestedRelations as $requestedRelation) {
40
-            if (isset($this->available[$requestedRelation])) {
41
-                $relations[$requestedRelation] = $this->available[$requestedRelation];
40
+            if (isset($this->available[ $requestedRelation ])) {
41
+                $relations[ $requestedRelation ] = $this->available[ $requestedRelation ];
42 42
             }
43 43
         }
44 44
         $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 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
                     } elseif ($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.
src/Foundation/Tests/TransformerTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     public function __construct($user)
64 64
     {
65 65
         $this->user = $user;
66
-        parent::__construct([]);
66
+        parent::__construct([ ]);
67 67
     }
68 68
 }
69 69
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 {
76 76
     public function toArray($request)
77 77
     {
78
-        return [];
78
+        return [ ];
79 79
     }
80 80
 
81 81
     public function transformUser(MachineTestModel $machine)
@@ -86,13 +86,13 @@  discard block
 block discarded – undo
86 86
 
87 87
 class UserIncludedMachineTestTransformer extends MachineTestTransformer
88 88
 {
89
-    public $include = ['user'];
89
+    public $include = [ 'user' ];
90 90
 }
91 91
 
92 92
 class UserTestTransformer extends Transformer
93 93
 {
94 94
     public function toArray($request)
95 95
     {
96
-        return [];
96
+        return [ ];
97 97
     }
98 98
 }
Please login to merge, or discard this patch.
src/Foundation/Abstracts/Transformers/Transformer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -30,28 +30,28 @@
 block discarded – undo
30 30
 {
31 31
     use IncludesRelations, HandlesLimit;
32 32
 
33
-    public $include = [];
33
+    public $include = [ ];
34 34
 
35
-    public $available = [];
35
+    public $available = [ ];
36 36
 
37 37
     public $limit = -1;
38 38
 
39
-    public function __construct($resource, $relations = [])
39
+    public function __construct($resource, $relations = [ ])
40 40
     {
41 41
         if (!($resource instanceof Model)) {
42 42
             throw new Exception('Object passed to the transformer resource method is not a eloquent model', 500);
43 43
         }
44 44
         $this->resource = $resource;
45
-        $relations = is_array($relations) ? $relations : [];
45
+        $relations = is_array($relations) ? $relations : [ ];
46 46
         parent::__construct(self::loadRelations($resource, $relations));
47 47
     }
48 48
 
49
-    public static function resource($model, array $relations = []): self
49
+    public static function resource($model, array $relations = [ ]): self
50 50
     {
51 51
         return new static($model, $relations);
52 52
     }
53 53
 
54
-    public static function collection($resource, array $relations = [])
54
+    public static function collection($resource, array $relations = [ ])
55 55
     {
56 56
         if (!($resource instanceof Collection)) {
57 57
             throw new Exception('Object passed to the transformer collection method is not a collection', 500);
Please login to merge, or discard this patch.
src/Modules/Horizon/Config/horizon.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         'production' => [
75 75
             'supervisor-1' => [
76 76
                 'connection' => 'redis',
77
-                'queue' => ['default'],
77
+                'queue' => [ 'default' ],
78 78
                 'balance' => 'simple',
79 79
                 'processes' => 10,
80 80
                 'tries' => 3,
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         'local' => [
85 85
             'supervisor-1' => [
86 86
                 'connection' => 'redis',
87
-                'queue' => ['default'],
87
+                'queue' => [ 'default' ],
88 88
                 'balance' => 'simple',
89 89
                 'processes' => 3,
90 90
                 'tries' => 3,
Please login to merge, or discard this patch.