Passed
Push — master ( 8475f2...95bd7d )
by Quim González
03:21
created
app/Providers/RouteServiceProvider.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
     protected function mapWebRoutes()
53 53
     {
54 54
         Route::middleware('web')
55
-             ->namespace($this->namespace)
56
-             ->group(base_path('routes/web.php'));
55
+                ->namespace($this->namespace)
56
+                ->group(base_path('routes/web.php'));
57 57
     }
58 58
 
59 59
     /**
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
     protected function mapApiRoutes()
67 67
     {
68 68
         Route::prefix('api')
69
-             ->middleware('api')
70
-             ->namespace($this->namespace)
71
-             ->group(base_path('routes/api.php'));
69
+                ->middleware('api')
70
+                ->namespace($this->namespace)
71
+                ->group(base_path('routes/api.php'));
72 72
     }
73 73
 }
Please login to merge, or discard this patch.
app/Http/Controllers/ApiUserController.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -21,17 +21,17 @@
 block discarded – undo
21 21
     public function store(Request $request)
22 22
     {
23 23
         $request->validate([
24
-           'name'     => 'required|max:255',
25
-           'username' => 'sometimes|required|max:255|unique:users',
26
-           'email'    => 'required|email|max:255|unique:users',
27
-           'password' => 'required|min:6',
24
+            'name'     => 'required|max:255',
25
+            'username' => 'sometimes|required|max:255|unique:users',
26
+            'email'    => 'required|email|max:255|unique:users',
27
+            'password' => 'required|min:6',
28 28
         ]);
29 29
 
30 30
         $user = User::create([
31
-               'name'     => $request->name,
32
-               'username' => $request->username,
33
-               'email'    => $request->email,
34
-               'password' => bcrypt($request->password),
31
+                'name'     => $request->name,
32
+                'username' => $request->username,
33
+                'email'    => $request->email,
34
+                'password' => bcrypt($request->password),
35 35
             ]);
36 36
 
37 37
         return $user;
Please login to merge, or discard this patch.
app/Http/Requests/ListTask.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,8 +19,12 @@
 block discarded – undo
19 19
 
20 20
     public function authorize()
21 21
     {
22
-        if($this->HasPermissionTo('list-tasks')) return true;
23
-        if ($this->owns('tasks')) return true;
22
+        if($this->HasPermissionTo('list-tasks')) {
23
+            return true;
24
+        }
25
+        if ($this->owns('tasks')) {
26
+            return true;
27
+        }
24 28
         return false;
25 29
 
26 30
         //si l'usuari té el permís ListTask -> autoritzo : no autoritzo.
Please login to merge, or discard this patch.
app/Http/Requests/UpdateTask.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,12 @@
 block discarded – undo
17 17
      */
18 18
     public function authorize()
19 19
     {
20
-        if($this->HasPermissionTo('update-tasks')) return true;
21
-        if ($this->owns('tasks')) return true;
20
+        if($this->HasPermissionTo('update-tasks')) {
21
+            return true;
22
+        }
23
+        if ($this->owns('tasks')) {
24
+            return true;
25
+        }
22 26
         return false;
23 27
     }
24 28
 
Please login to merge, or discard this patch.
app/Http/Requests/UpdateUser.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,9 @@
 block discarded – undo
15 15
      */
16 16
     public function authorize()
17 17
     {
18
-        if ($this->hasPermissionTo('update-users')) return true;
18
+        if ($this->hasPermissionTo('update-users')) {
19
+            return true;
20
+        }
19 21
         return false;
20 22
     }
21 23
 
Please login to merge, or discard this patch.
app/Http/Requests/StoreTask.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,12 @@
 block discarded – undo
16 16
      */
17 17
     public function authorize()
18 18
     {
19
-        if ($this->hasPermissionTo('store-tasks')) return true;
20
-        if (Auth::user()->id === $this->user_id) return true;
19
+        if ($this->hasPermissionTo('store-tasks')) {
20
+            return true;
21
+        }
22
+        if (Auth::user()->id === $this->user_id) {
23
+            return true;
24
+        }
21 25
         return false;
22 26
         //return Auth::user()->HasPermissionTo('store-tasks');
23 27
     }
Please login to merge, or discard this patch.
app/Http/Requests/ListUser.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,9 @@
 block discarded – undo
16 16
      */
17 17
     public function authorize()
18 18
     {
19
-        if ($this->hasPermissionTo('list-users')) return true;
19
+        if ($this->hasPermissionTo('list-users')) {
20
+            return true;
21
+        }
20 22
         return false;
21 23
     }
22 24
 
Please login to merge, or discard this patch.
app/Http/Requests/ShowTask.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,12 @@
 block discarded – undo
16 16
      */
17 17
     public function authorize()
18 18
     {
19
-        if($this->HasPermissionTo('show-tasks')) return true;
20
-        if ($this->owns('tasks')) return true;
19
+        if($this->HasPermissionTo('show-tasks')) {
20
+            return true;
21
+        }
22
+        if ($this->owns('tasks')) {
23
+            return true;
24
+        }
21 25
         return false;
22 26
         //return Auth::user()->HasPermissionTo('show-tasks');
23 27
     }
Please login to merge, or discard this patch.
app/Http/Requests/Traits/ChecksPermissions.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,7 +19,9 @@  discard block
 block discarded – undo
19 19
      */
20 20
     protected function hasPermissionTo($permission)
21 21
     {
22
-        if (Auth::user()->hasPermissionTo($permission)) return true;
22
+        if (Auth::user()->hasPermissionTo($permission)) {
23
+            return true;
24
+        }
23 25
         return false;
24 26
     }
25 27
 
@@ -32,7 +34,9 @@  discard block
 block discarded – undo
32 34
     protected function owns($model,$field = 'user_id')
33 35
     {
34 36
         //todo
35
-        if (Auth::user()->id == $this->$model->$field) return true;
37
+        if (Auth::user()->id == $this->$model->$field) {
38
+            return true;
39
+        }
36 40
         return false;
37 41
     }
38 42
 }
39 43
\ No newline at end of file
Please login to merge, or discard this patch.