Test Failed
Push — feature/immutable-application-... ( e0cf39...238d28 )
by Tristan
33:02 queued 10s
created
app/Http/Middleware/CheckIfAdmin.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
      */
23 23
     private function checkIfUserIsAdmin($user)
24 24
     {
25
-        return ($user->isAdmin());
25
+        return ($user->isAdmin ());
26 26
     }
27 27
 
28 28
     /**
@@ -34,10 +34,10 @@  discard block
 block discarded – undo
34 34
      */
35 35
     private function respondToUnauthorizedRequest($request)
36 36
     {
37
-        if ($request->ajax() || $request->wantsJson()) {
38
-            return response(trans('backpack::base.unauthorized'), 401);
37
+        if ($request->ajax () || $request->wantsJson ()) {
38
+            return response (trans ('backpack::base.unauthorized'), 401);
39 39
         } else {
40
-            return redirect()->guest(backpack_url('login'));
40
+            return redirect ()->guest (backpack_url ('login'));
41 41
         }
42 42
     }
43 43
 
@@ -51,14 +51,14 @@  discard block
 block discarded – undo
51 51
      */
52 52
     public function handle($request, Closure $next)
53 53
     {
54
-        if (backpack_auth()->guest()) {
55
-            return $this->respondToUnauthorizedRequest($request);
54
+        if (backpack_auth ()->guest ()) {
55
+            return $this->respondToUnauthorizedRequest ($request);
56 56
         }
57 57
 
58
-        if (!$this->checkIfUserIsAdmin(backpack_user())) {
59
-            return $this->respondToUnauthorizedRequest($request);
58
+        if (!$this->checkIfUserIsAdmin (backpack_user ())) {
59
+            return $this->respondToUnauthorizedRequest ($request);
60 60
         }
61 61
 
62
-        return $next($request);
62
+        return $next ($request);
63 63
     }
64 64
 }
Please login to merge, or discard this patch.
app/Http/Middleware/LocalOnly.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,9 +15,9 @@
 block discarded – undo
15 15
      */
16 16
     public function handle($request, Closure $next)
17 17
     {
18
-        if (\App::environment('local')) {
19
-            return $next($request);
18
+        if (\App::environment ('local')) {
19
+            return $next ($request);
20 20
         }
21
-        abort(404);
21
+        abort (404);
22 22
     }
23 23
 }
Please login to merge, or discard this patch.
app/Http/Middleware/RedirectIfAuthenticated.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -18,16 +18,16 @@
 block discarded – undo
18 18
      */
19 19
     public function handle($request, Closure $next, $guard = null)
20 20
     {
21
-        if (Auth::guard($guard)->check()) {
22
-            if (Auth::user()->isAdmin()) {
23
-                return redirect(backpack_url(''));
24
-            } elseif (WhichPortal::isManagerPortal()) {
25
-                return redirect(route('manager.home'));
21
+        if (Auth::guard ($guard)->check ()) {
22
+            if (Auth::user ()->isAdmin ()) {
23
+                return redirect (backpack_url (''));
24
+            } elseif (WhichPortal::isManagerPortal ()) {
25
+                return redirect (route ('manager.home'));
26 26
             } else {
27
-                return redirect(route('home'));
27
+                return redirect (route ('home'));
28 28
             }
29 29
         }
30 30
 
31
-        return $next($request);
31
+        return $next ($request);
32 32
     }
33 33
 }
Please login to merge, or discard this patch.
app/Http/Middleware/CheckRole.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -21,21 +21,21 @@
 block discarded – undo
21 21
     public function handle($request, Closure $next, $role)
22 22
     {
23 23
         // If user logged in as admin, always pass, regardless of $role
24
-        if (Auth::check() && Auth::user()->isAdmin()) {
25
-            Log::info('CheckRole Bypassed as Admin');
26
-            return $next($request);
24
+        if (Auth::check () && Auth::user ()->isAdmin ()) {
25
+            Log::info ('CheckRole Bypassed as Admin');
26
+            return $next ($request);
27 27
         }
28 28
 
29 29
         // Redirect if not logged in, or if not the correct role
30
-        if (Auth::guest() || !Auth::user()->hasRole($role)) {
31
-            Log::info('CheckRole Failed');
30
+        if (Auth::guest () || !Auth::user ()->hasRole ($role)) {
31
+            Log::info ('CheckRole Failed');
32 32
             // TODO: redirect to some sort of error messag
33
-            if (WhichPortal::isManagerPortal()) {
34
-                return redirect(route('manager.home'));
33
+            if (WhichPortal::isManagerPortal ()) {
34
+                return redirect (route ('manager.home'));
35 35
             } else {
36
-                return redirect(route('home'));
36
+                return redirect (route ('home'));
37 37
             }
38 38
         }
39
-        return $next($request);
39
+        return $next ($request);
40 40
     }
41 41
 }
Please login to merge, or discard this patch.
app/Http/Controllers/CourseController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,15 +16,15 @@
 block discarded – undo
16 16
      */
17 17
     public function destroy(Request $request, Course $course)
18 18
     {
19
-        $this->authorize('delete', $course);
20
-        $course->delete();
19
+        $this->authorize ('delete', $course);
20
+        $course->delete ();
21 21
 
22
-        if ($request->ajax()) {
22
+        if ($request->ajax ()) {
23 23
             return [
24 24
                 'message' => 'Course delete',
25 25
             ];
26 26
         }
27 27
 
28
-        return back();
28
+        return back ();
29 29
     }
30 30
 }
Please login to merge, or discard this patch.
app/Http/Controllers/Api/DepartmentController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,6 +14,6 @@
 block discarded – undo
14 14
      */
15 15
     public function index()
16 16
     {
17
-        return Department::all()->map->toApiArray();
17
+        return Department::all ()->map->toApiArray ();
18 18
     }
19 19
 }
Please login to merge, or discard this patch.
app/Http/Controllers/Api/SkillController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,21 +14,21 @@
 block discarded – undo
14 14
      */
15 15
     public function index()
16 16
     {
17
-        $skills = Skill::with('classifications')->get();
17
+        $skills = Skill::with ('classifications')->get ();
18 18
         $skillsArray = [];
19 19
         // TODO: improve effiency of getting translations.
20 20
         foreach ($skills as $skill) {
21 21
             $translations = [
22 22
                 'en' => [
23
-                    'name' => $skill->getTranslation('name', 'en'),
24
-                    'description' => $skill->getTranslation('description', 'en'),
23
+                    'name' => $skill->getTranslation ('name', 'en'),
24
+                    'description' => $skill->getTranslation ('description', 'en'),
25 25
                 ],
26 26
                 'fr' => [
27
-                    'name' => $skill->getTranslation('name', 'fr'),
28
-                    'description' => $skill->getTranslation('description', 'fr'),
27
+                    'name' => $skill->getTranslation ('name', 'fr'),
28
+                    'description' => $skill->getTranslation ('description', 'fr'),
29 29
                 ]
30 30
             ];
31
-            $skillsArray[] = array_merge($skill->toArray(), $translations);
31
+            $skillsArray[] = array_merge ($skill->toArray (), $translations);
32 32
         }
33 33
         return ['skills' => $skillsArray];
34 34
     }
Please login to merge, or discard this patch.
app/Http/Controllers/Api/ManagerApiController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     public function __construct()
17 17
     {
18 18
         // This applies the appropriate policy to each resource route.
19
-        $this->authorizeResource(Manager::class, 'manager');
19
+        $this->authorizeResource (Manager::class, 'manager');
20 20
     }
21 21
 
22 22
     /**
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public function show(Manager $manager)
50 50
     {
51
-        return response()->json($manager->toApiArray());
51
+        return response ()->json ($manager->toApiArray ());
52 52
     }
53 53
 
54 54
     /**
@@ -58,11 +58,11 @@  discard block
 block discarded – undo
58 58
      */
59 59
     public function showAuthenticated()
60 60
     {
61
-        $user = Auth::user();
61
+        $user = Auth::user ();
62 62
         if ($user !== null && $user->manager !== null) {
63
-            return response()->json($user->manager->toApiArray());
63
+            return response ()->json ($user->manager->toApiArray ());
64 64
         }
65
-        return response()->json([]);
65
+        return response ()->json ([]);
66 66
     }
67 67
 
68 68
     /**
@@ -74,10 +74,10 @@  discard block
 block discarded – undo
74 74
      */
75 75
     public function update(UpdateManagerApi $request, Manager $manager)
76 76
     {
77
-        $validated = $request->validated();
78
-        $manager->fill($validated);
79
-        $manager->save();
80
-        return response()->json($manager->toApiArray());
77
+        $validated = $request->validated ();
78
+        $manager->fill ($validated);
79
+        $manager->save ();
80
+        return response ()->json ($manager->toApiArray ());
81 81
     }
82 82
 
83 83
     /**
Please login to merge, or discard this patch.
app/Http/Controllers/DegreeController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,15 +16,15 @@
 block discarded – undo
16 16
      */
17 17
     public function destroy(Request $request, Degree $degree)
18 18
     {
19
-        $this->authorize('delete', $degree);
20
-        $degree->delete();
19
+        $this->authorize ('delete', $degree);
20
+        $degree->delete ();
21 21
 
22
-        if ($request->ajax()) {
22
+        if ($request->ajax ()) {
23 23
             return [
24 24
                 'message' => 'Degree deleted',
25 25
             ];
26 26
         }
27 27
 
28
-        return back();
28
+        return back ();
29 29
     }
30 30
 }
Please login to merge, or discard this patch.