Passed
Push — npm/audit-fix ( 9e66ec )
by Yonathan
29:50 queued 14:40
created
app/Http/Middleware/DateLocale.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,10 +14,10 @@
 block discarded – undo
14 14
      * @param  \Closure  $next
15 15
      * @return mixed
16 16
      */
17
-    public function handle($request, Closure $next)
17
+    public function handle ($request, Closure $next)
18 18
     {
19
-        Date::setLocale(app()->getLocale());
19
+        Date::setLocale (app ()->getLocale ());
20 20
         
21
-        return $next($request);
21
+        return $next ($request);
22 22
     }
23 23
 }
Please login to merge, or discard this patch.
app/Http/Middleware/FinishManagerRegistration.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,15 +12,15 @@
 block discarded – undo
12 12
      * @param  \Closure  $next
13 13
      * @return mixed
14 14
      */
15
-    public function handle($request, Closure $next)
15
+    public function handle ($request, Closure $next)
16 16
     {
17
-        $user = $request->user();
17
+        $user = $request->user ();
18 18
 
19
-        if ($user !== null && $user->isManager() && !$user->isGovIdentityConfirmed()) {
20
-            $request->session()->put('url.expected', $request->url());
21
-            return redirect(route('manager.first_visit'));
19
+        if ($user !== null && $user->isManager () && !$user->isGovIdentityConfirmed ()) {
20
+            $request->session ()->put ('url.expected', $request->url ());
21
+            return redirect (route ('manager.first_visit'));
22 22
         }
23 23
 
24
-        return $next($request);
24
+        return $next ($request);
25 25
     }
26 26
 }
Please login to merge, or discard this patch.
app/Http/Middleware/CheckIfAdmin.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@  discard block
 block discarded – undo
20 20
      *
21 21
      * @return bool [description]
22 22
      */
23
-    private function checkIfUserIsAdmin($user)
23
+    private function checkIfUserIsAdmin ($user)
24 24
     {
25
-        return ($user->isAdmin());
25
+        return ($user->isAdmin ());
26 26
     }
27 27
 
28 28
     /**
@@ -32,12 +32,12 @@  discard block
 block discarded – undo
32 32
      *
33 33
      * @return [type] [description]
34 34
      */
35
-    private function respondToUnauthorizedRequest($request)
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
 
@@ -49,16 +49,16 @@  discard block
 block discarded – undo
49 49
      *
50 50
      * @return mixed
51 51
      */
52
-    public function handle($request, Closure $next)
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/InitializeUser.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -19,43 +19,43 @@
 block discarded – undo
19 19
      * @param  \Closure  $next
20 20
      * @return mixed
21 21
      */
22
-    public function handle($request, Closure $next)
22
+    public function handle ($request, Closure $next)
23 23
     {
24
-        if (Auth::check()) {
25
-            $user = Auth::user();
24
+        if (Auth::check ()) {
25
+            $user = Auth::user ();
26 26
 
27 27
             // If running in a local environment, and FORCE_ADMIN is true,
28 28
             // automatically set any logged in user to (temporarilly) be an admin
29
-            if (App::environment() == 'local' && Config::get('app.force_admin')) {
30
-                $user->setRole('admin');
31
-                $user->save();
29
+            if (App::environment () == 'local' && Config::get ('app.force_admin')) {
30
+                $user->setRole ('admin');
31
+                $user->save ();
32 32
             }
33 33
 
34 34
             // Ensure the user has a proper profile associated with it
35 35
             // If no profile exists yet create one.
36 36
             // Admins should be given an applicant and manager profile
37
-            if ($user->isApplicant() ||
38
-                    $user->isAdmin() ) {
37
+            if ($user->isApplicant () ||
38
+                    $user->isAdmin ()) {
39 39
                 $applicantProfile = $user->applicant;
40 40
                 if ($applicantProfile === null) {
41
-                    $applicantProfile = new Applicant();
41
+                    $applicantProfile = new Applicant ();
42 42
                     $applicantProfile->user_id = $user->id;
43
-                    $applicantProfile->save();
44
-                    $user->refresh();
43
+                    $applicantProfile->save ();
44
+                    $user->refresh ();
45 45
                 }
46 46
             }
47
-            if ($user->isManager() ||
48
-            $user->isAdmin()) {
47
+            if ($user->isManager () ||
48
+            $user->isAdmin ()) {
49 49
                 $managerProfile = $user->manager;
50 50
                 if ($managerProfile === null) {
51
-                    $managerProfile = new Manager();
51
+                    $managerProfile = new Manager ();
52 52
                     $managerProfile->user_id = $user->id;
53
-                    $managerProfile->save();
54
-                    $user->refresh();
53
+                    $managerProfile->save ();
54
+                    $user->refresh ();
55 55
                 }
56 56
             }
57 57
         }
58 58
 
59
-        return $next($request);
59
+        return $next ($request);
60 60
     }
61 61
 }
Please login to merge, or discard this patch.
app/Http/Middleware/CheckRole.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -18,24 +18,24 @@
 block discarded – undo
18 18
      * @param  string  $role
19 19
      * @return mixed
20 20
      */
21
-    public function handle($request, Closure $next, $role)
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/Middleware/FullFrameGuard.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,11 +12,11 @@
 block discarded – undo
12 12
      * @param  \Closure  $next
13 13
      * @return mixed
14 14
      */
15
-    public function handle($request, Closure $next) {
15
+    public function handle ($request, Closure $next) {
16 16
 
17
-        $response = $next($request);
17
+        $response = $next ($request);
18 18
 
19
-        $response->headers->set('X-Frame-Options', 'SAMEORIGIN');
19
+        $response->headers->set ('X-Frame-Options', 'SAMEORIGIN');
20 20
 
21 21
         return $response;
22 22
     }
Please login to merge, or discard this patch.
app/Http/Middleware/LocalOnly.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,11 +13,11 @@
 block discarded – undo
13 13
      * @param  \Closure  $next
14 14
      * @return mixed
15 15
      */
16
-    public function handle($request, Closure $next)
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   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -16,18 +16,18 @@
 block discarded – undo
16 16
      * @param  string|null  $guard
17 17
      * @return mixed
18 18
      */
19
-    public function handle($request, Closure $next, $guard = null)
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/Exceptions/Handler.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -58,21 +58,21 @@  discard block
 block discarded – undo
58 58
      * @param  \Exception  $exception
59 59
      * @return void
60 60
      */
61
-    public function report(Exception $exception)
61
+    public function report (Exception $exception)
62 62
     {
63 63
         if ($exception instanceof TokenMismatchException) {
64 64
             $logData = [
65
-                'requestToken' => request()->header('x-csrf-token'),
66
-                'sessionToken' => session()->token(),
67
-                'session' => session()->all(),
68
-                'user' => request()->user(),
69
-                'requestUrl' => request()->url()
65
+                'requestToken' => request ()->header ('x-csrf-token'),
66
+                'sessionToken' => session ()->token (),
67
+                'session' => session ()->all (),
68
+                'user' => request ()->user (),
69
+                'requestUrl' => request ()->url ()
70 70
             ];
71
-            $message = '419 CSRF Token Mismatch. ' . collect($logData)->toJson();
72
-            Log::debug($message);
71
+            $message = '419 CSRF Token Mismatch. '.collect ($logData)->toJson ();
72
+            Log::debug ($message);
73 73
         }
74 74
 
75
-        parent::report($exception);
75
+        parent::report ($exception);
76 76
     }
77 77
 
78 78
     /**
@@ -81,15 +81,15 @@  discard block
 block discarded – undo
81 81
      *
82 82
      * @return array
83 83
      */
84
-    protected function context()
84
+    protected function context ()
85 85
     {
86 86
         try {
87
-            return array_filter([
88
-                'userId' => Auth::id(),
87
+            return array_filter ([
88
+                'userId' => Auth::id (),
89 89
                 // 'email' => optional(Auth::user())->email,
90
-                'url' => Request::path(),
91
-                'method' => Request::method(),
92
-                'referer' => Request::header('referer', '')
90
+                'url' => Request::path (),
91
+                'method' => Request::method (),
92
+                'referer' => Request::header ('referer', '')
93 93
             ]);
94 94
         } catch (Throwable $e) {
95 95
             return [];
@@ -103,17 +103,17 @@  discard block
 block discarded – undo
103 103
      * @param  \Exception  $exception
104 104
      * @return \Illuminate\Http\Response
105 105
      */
106
-    public function render($request, Exception $exception)
106
+    public function render ($request, Exception $exception)
107 107
     {
108 108
         if ($exception instanceof AdminException) {
109
-            return $exception->render($request);
109
+            return $exception->render ($request);
110 110
         }
111 111
         if ($exception instanceof TokenMismatchException) {
112
-            $newMessage = $exception->getMessage() . ' ' . Lang::get('errors.refresh_page');
113
-            $modifiedException = new TokenMismatchException($newMessage, $exception->getCode(), $exception);
114
-            return parent::render($request, $modifiedException);
112
+            $newMessage = $exception->getMessage ().' '.Lang::get ('errors.refresh_page');
113
+            $modifiedException = new TokenMismatchException ($newMessage, $exception->getCode (), $exception);
114
+            return parent::render ($request, $modifiedException);
115 115
         }
116
-        return parent::render($request, $exception);
116
+        return parent::render ($request, $exception);
117 117
     }
118 118
 
119 119
     /**
@@ -123,17 +123,17 @@  discard block
 block discarded – undo
123 123
      * @param  \Illuminate\Auth\AuthenticationException  $exception
124 124
      * @return \Illuminate\Http\Response
125 125
      */
126
-    protected function unauthenticated($request, AuthenticationException $exception)
126
+    protected function unauthenticated ($request, AuthenticationException $exception)
127 127
     {
128
-        if ($request->expectsJson()) {
129
-            return response()->json(['error' => 'Unauthenticated.'], 401);
128
+        if ($request->expectsJson ()) {
129
+            return response ()->json (['error' => 'Unauthenticated.'], 401);
130 130
         }
131
-        if (WhichPortal::isManagerPortal()) {
132
-            $loginRoute = route('manager.login');
131
+        if (WhichPortal::isManagerPortal ()) {
132
+            $loginRoute = route ('manager.login');
133 133
         } else {
134
-            $loginRoute = route('login');
134
+            $loginRoute = route ('login');
135 135
         }
136
-        return redirect()->guest($loginRoute);
136
+        return redirect ()->guest ($loginRoute);
137 137
     }
138 138
 
139 139
     /**
@@ -143,18 +143,18 @@  discard block
 block discarded – undo
143 143
      * @param  \Symfony\Component\HttpKernel\Exception\HttpExceptionInterface  $e
144 144
      * @return \Symfony\Component\HttpFoundation\Response
145 145
      */
146
-    protected function renderHttpException(HttpExceptionInterface $e)
146
+    protected function renderHttpException (HttpExceptionInterface $e)
147 147
     {
148
-        if (!view()->exists("errors.{$e->getStatusCode()}")) {
149
-            return response()->view('errors.default', [
148
+        if (!view ()->exists ("errors.{$e->getStatusCode ()}")) {
149
+            return response ()->view ('errors.default', [
150 150
                 'exception' => $e,
151
-                'goc' => Lang::get('common/goc'),
152
-                'alert' => Lang::get('common/alert'),
151
+                'goc' => Lang::get ('common/goc'),
152
+                'alert' => Lang::get ('common/alert'),
153 153
                 'error' => [
154 154
                     'title' => 'Error'
155 155
                 ]
156
-            ], $e->getStatusCode(), $e->getHeaders());
156
+            ], $e->getStatusCode (), $e->getHeaders ());
157 157
         }
158
-        return parent::renderHttpException($e);
158
+        return parent::renderHttpException ($e);
159 159
     }
160 160
 }
Please login to merge, or discard this patch.