Passed
Push — master ( 85c419...35703b )
by Arthur
07:22
created
src/Foundation/Abstracts/Transformers/Transformer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,22 +26,22 @@
 block discarded – undo
26 26
      */
27 27
     public function resolve($request = null)
28 28
     {
29
-        return array_merge(parent::resolve($request),$this->filter($this->includeRelations()));
29
+        return array_merge(parent::resolve($request), $this->filter($this->includeRelations()));
30 30
     }
31 31
 
32 32
     protected function includeRelations()
33 33
     {
34
-        $relations = [];
34
+        $relations = [ ];
35 35
         foreach ($this->relations as $relation) {
36
-            if (is_string($relation) && method_exists(static::class, 'transform' . ucfirst(strtolower($relation)))) {
37
-                $method = 'transform' . ucfirst(strtolower($relation));
36
+            if (is_string($relation) && method_exists(static::class, 'transform'.ucfirst(strtolower($relation)))) {
37
+                $method = 'transform'.ucfirst(strtolower($relation));
38 38
                 $data = $this->$method($this->resource);
39 39
                 if ($data instanceof JsonResource) {
40 40
                     $data->jsonSerialize();
41 41
                 }
42
-                $relations[strtolower($relation)] = $data;
42
+                $relations[ strtolower($relation) ] = $data;
43 43
             } else {
44
-                throw new \Exception("invalid relation or not relation_transform_method given in " . get_short_class_name(static::class));
44
+                throw new \Exception("invalid relation or not relation_transform_method given in ".get_short_class_name(static::class));
45 45
             }
46 46
 
47 47
         }
Please login to merge, or discard this patch.
src/Modules/User/Entities/User.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,16 +40,16 @@
 block discarded – undo
40 40
      */
41 41
     protected $table = 'users';
42 42
 
43
-    protected $with = ['roles', 'permissions'];
43
+    protected $with = [ 'roles', 'permissions' ];
44 44
 
45 45
     public $cacheTime = 60;
46 46
 
47
-    public $secondaryCacheIndexes = ['identity_id'];
47
+    public $secondaryCacheIndexes = [ 'identity_id' ];
48 48
 
49 49
     /**
50 50
      * @var array
51 51
      */
52
-    protected $guarded = [];
52
+    protected $guarded = [ ];
53 53
 
54 54
     protected $casts = [
55 55
         'email_verified' => 'bool'
Please login to merge, or discard this patch.
src/Modules/Demo/Jobs/AlterDemoDataJob.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
                 'cpu_usage' => rand(0, 100),
50 50
                 'memory_usage' => rand(1, $machine->memory_available),
51 51
             ]);
52
-            $this->machineService->update($machine, ['online' => (bool)rand(0, 1)]);
52
+            $this->machineService->update($machine, [ 'online' => (bool) rand(0, 1) ]);
53 53
         }
54 54
     }
55 55
 }
Please login to merge, or discard this patch.
src/Modules/Machine/Database/factories/MachineFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 use Faker\Generator as Faker;
4 4
 
5
-$factory->define(Modules\Machine\Entities\Machine::class, function (Faker $faker) {
5
+$factory->define(Modules\Machine\Entities\Machine::class, function(Faker $faker) {
6 6
     $os = [
7 7
         'MAC',
8 8
         'WINDOWS',
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
         'memory_usage'     => rand(512, 8192),
22 22
         'memory_available' => 8192,
23 23
         'cpu_usage'        => rand(0, 100),
24
-        'cpu_clock'         => rand(3,5),
24
+        'cpu_clock'         => rand(3, 5),
25 25
         'online'            => $faker->boolean
26 26
     ];
27 27
 });
Please login to merge, or discard this patch.
src/Foundation/Policies/OwnershipPolicy.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -102,8 +102,9 @@
 block discarded – undo
102 102
     */
103 103
     public function before($user, $ability)
104 104
     {
105
-        if ($user->isAdmin())
106
-            return true;
105
+        if ($user->isAdmin()) {
106
+                    return true;
107
+        }
107 108
     }
108 109
 
109 110
 }
Please login to merge, or discard this patch.
src/Foundation/Responses/ApiResponse.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 
12 12
 class ApiResponse
13 13
 {
14
-    public static function deleted(){
14
+    public static function deleted() {
15 15
         return \response()->noContent(204);
16 16
     }
17 17
 }
Please login to merge, or discard this patch.
src/Foundation/Traits/MutatesRequest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,6 +13,6 @@
 block discarded – undo
13 13
 {
14 14
     public function injectUserId($request): array
15 15
     {
16
-        return array_merge($request->toArray(), ['user_id' => get_authenticated_user_id()]);
16
+        return array_merge($request->toArray(), [ 'user_id' => get_authenticated_user_id() ]);
17 17
     }
18 18
 }
Please login to merge, or discard this patch.
src/Foundation/Traits/HandlesOwnership.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,9 +14,9 @@
 block discarded – undo
14 14
 
15 15
 trait HandlesOwnership
16 16
 {
17
-    public function isOwner(?Ownable $model){
17
+    public function isOwner(?Ownable $model) {
18 18
 
19
-        if($model === null)
19
+        if ($model === null)
20 20
             throw new NotFoundHttpException("Could not found resouce.");
21 21
 
22 22
         $this->authorize('access', $model);
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,9 @@
 block discarded – undo
16 16
 {
17 17
     public function isOwner(?Ownable $model){
18 18
 
19
-        if($model === null)
20
-            throw new NotFoundHttpException("Could not found resouce.");
19
+        if($model === null) {
20
+                    throw new NotFoundHttpException("Could not found resouce.");
21
+        }
21 22
 
22 23
         $this->authorize('access', $model);
23 24
     }
Please login to merge, or discard this patch.