Passed
Push — feature/add-2fa-support ( 8771d9...330d32 )
by Tristan
08:52 queued 11s
created
app/Http/ViewComposers/MenuComposer.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -209,13 +209,13 @@
 block discarded – undo
209 209
                 'settings_link' => route('manager.settings.edit'),
210 210
             ];
211 211
         } elseif (WhichPortal::isAdminPortal()) {
212
-             $loginModals = [
212
+                $loginModals = [
213 213
                 'modals' => Lang::get('common/login_modals'),
214 214
                 'register_link' => route('register'),
215 215
                 'login_link' => backpack_url('login'),
216 216
                 'logout_link' => backpack_url('logout'),
217 217
                 'settings_link' => route('settings.edit'),
218
-             ];
218
+                ];
219 219
         } else {
220 220
             $loginModals = [
221 221
                 'modals' => Lang::get('common/login_modals'),
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/TwoFactorController.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
             $user->email,
21 21
             $secret
22 22
         );
23
-         $profile_url = '';
23
+            $profile_url = '';
24 24
         if (WhichPortal::isApplicantPortal()) {
25 25
             $profile_url = route('settings.edit');
26 26
         } elseif (WhichPortal::isManagerPortal()) {
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/RecoveryCodeController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
         if ($valid_codes->contains($recovery_code)) {
70 70
             $authenticator = app(Authenticator::class)->boot($request);
71 71
             $authenticator->login();
72
-            $still_valid_codes = $valid_codes->filter(function ($value) use ($recovery_code) {
72
+            $still_valid_codes = $valid_codes->filter(function($value) use ($recovery_code) {
73 73
                 return $value != $recovery_code;
74 74
             });
75 75
             $user->recovery_codes = $still_valid_codes->toArray();
Please login to merge, or discard this patch.
routes/web.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -19,10 +19,10 @@  discard block
 block discarded – undo
19 19
         'prefix' => LaravelLocalization::setLocale(),
20 20
         'middleware' => ['localeSessionRedirect', 'localizationRedirect', 'localeViewPath']
21 21
     ],
22
-    function (): void {
22
+    function(): void {
23 23
         /* Routes used for local demos */
24 24
         /* If creating public demos, make sure to add a meta robots noindex, nofollow tag */
25
-        Route::group(['prefix' => 'demo'], function (): void {
25
+        Route::group(['prefix' => 'demo'], function(): void {
26 26
 
27 27
             /* Temporary Blog Index */
28 28
             Route::view('blog', 'common/blog-index')->middleware('localOnly')->name('blog');
@@ -51,13 +51,13 @@  discard block
 block discarded – undo
51 51
             Route::view('builder-08', 'manager/builder-08')->middleware('localOnly')->name('jpb8');
52 52
         });
53 53
 
54
-        Route::group(['prefix' => config('app.applicant_prefix')], function (): void {
54
+        Route::group(['prefix' => config('app.applicant_prefix')], function(): void {
55 55
 
56 56
             Route::get('two-factor/use-recovery-code', 'Auth\RecoveryCodeController@use')->name('recovery_codes.use');
57 57
             Route::post('two-factor/use-recovery-code', 'Auth\RecoveryCodeController@authenticate')->name('recovery_codes.authenticate');
58 58
 
59 59
             /* Require being logged in */
60
-            Route::middleware(['auth'])->group(function () : void {
60
+            Route::middleware(['auth'])->group(function() : void {
61 61
 
62 62
                 /* Managers */
63 63
                 Route::get('managers/{manager}', 'ManagerProfileController@show')
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
              * IF user is logged in AND has activated 2fa, require one-time password.
70 70
              * This should include all routes except those related to authentication, to avoid loops.
71 71
              */
72
-            Route::middleware(['2fa'])->group(function (): void {
72
+            Route::middleware(['2fa'])->group(function(): void {
73 73
                 Route::post('/2fa', 'Auth\TwoFactorController@redirectToExpected')->name('2fa');
74 74
 
75 75
                 /* Home */
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
                     ->name('jobs.show');
84 84
 
85 85
                 /* Require being logged in as applicant */
86
-                Route::middleware(['auth', 'role:applicant'])->group(function (): void {
86
+                Route::middleware(['auth', 'role:applicant'])->group(function(): void {
87 87
 
88 88
                     // Application permissions are handled within the controller instead of with middleware.
89 89
                     /* Applications */
@@ -253,9 +253,9 @@  discard block
 block discarded – undo
253 253
         });
254 254
 
255 255
         /* Manager Portal =========================================================== */
256
-        Route::group(['prefix' => config('app.manager_prefix')], function (): void {
256
+        Route::group(['prefix' => config('app.manager_prefix')], function(): void {
257 257
 
258
-            Route::middleware(['finishManagerRegistration'])->group(function (): void {
258
+            Route::middleware(['finishManagerRegistration'])->group(function(): void {
259 259
 
260 260
                 Route::get('two-factor/use-recovery-code', 'Auth\RecoveryCodeController@use')->name('manager.recovery_codes.use');
261 261
                 Route::post('two-factor/use-recovery-code', 'Auth\RecoveryCodeController@authenticate')->name('manager.recovery_codes.authenticate');
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
                  * IF user is logged in AND has activated 2fa, require one-time password.
265 265
                  * This should include all routes except those related to authentication, to avoid loops.
266 266
                  */
267
-                Route::middleware(['2fa'])->group(function (): void {
267
+                Route::middleware(['2fa'])->group(function(): void {
268 268
 
269 269
                     Route::post('/2fa', 'Auth\TwoFactorController@redirectToExpected')->name('manager.2fa');
270 270
 
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
                         'ManagerProfileController@faq'
283 283
                     )->name('manager.faq.section');
284 284
 
285
-                    Route::middleware(['auth', 'role:manager'])->group(function (): void {
285
+                    Route::middleware(['auth', 'role:manager'])->group(function(): void {
286 286
 
287 287
                         Route::get('profile', 'ManagerProfileController@editAuthenticated')->name('manager.profile');
288 288
 
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
                             ->name('manager.profile.update');
298 298
 
299 299
                         /* Reviewing applications/applicants requires two-factor authentication */
300
-                        Route::middleware(['2fa.required'])->group(function (): void {
300
+                        Route::middleware(['2fa.required'])->group(function(): void {
301 301
                             Route::get('jobs/{jobPoster}/applications', 'ApplicationByJobController@index')
302 302
                                 ->where('jobPoster', '[0-9]+')
303 303
                                 ->middleware('can:reviewApplicationsFor,jobPoster')
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
 
431 431
             // These routes must be excluded from the finishManagerRegistration middleware
432 432
             // to avoid an infinite loop of redirects.
433
-            Route::middleware(['auth', 'role:manager'])->group(function (): void {
433
+            Route::middleware(['auth', 'role:manager'])->group(function(): void {
434 434
                 Route::get('first-visit', 'Auth\FirstVisitController@showFirstVisitManagerForm')
435 435
                     ->name('manager.first_visit');
436 436
                 Route::post('finish_registration', 'Auth\FirstVisitController@finishManagerRegistration')
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
         /* AJAX calls =============================================================== */
457 457
 
458 458
         /* Require being logged in */
459
-        Route::middleware(['auth'])->group(function (): void {
459
+        Route::middleware(['auth'])->group(function(): void {
460 460
 
461 461
             Route::delete('courses/{course}', 'CourseController@destroy')
462 462
                 ->middleware('can:delete,course')
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
                 'prefix' => 'admin',
522 522
                 'middleware' => ['auth', 'role:admin']
523 523
             ],
524
-            function (): void {
524
+            function(): void {
525 525
                 /* Edit Job */
526 526
                 Route::get('jobs/{jobPoster}/edit', 'JobController@edit')
527 527
                     ->where('jobPoster', '[0-9]+')
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
     'prefix' => 'admin',
543 543
     'middleware' => ['auth', 'role:admin']
544 544
     ],
545
-    function (): void {
545
+    function(): void {
546 546
         // This page is non-localized, because the middleware that redirects to localized
547 547
         // pages changes POSTs to GETs and messes up the request.
548 548
         Route::post('jobs/create/as-manager/{manager}', 'JobController@createAsManager')
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
 /* ALL NON-LOCALIZED ROUTES **/
565 565
 
566 566
 /* API routes - currently using same default http auth, but not localized */
567
-Route::group(['prefix' => 'api'], function (): void {
567
+Route::group(['prefix' => 'api'], function(): void {
568 568
     // Protected by a gate in the controller, instead of policy middleware.
569 569
     Route::get('jobs/{jobPoster}/assessment-plan', 'AssessmentPlanController@getForJob');
570 570
     // Public, not protected by policy or gate.
@@ -607,7 +607,7 @@  discard block
 block discarded – undo
607 607
         ->name('api.jobs.submit');
608 608
     Route::resource('jobs', 'Api\JobApiController')->only([
609 609
         'show', 'store', 'update'
610
-    ])->names([ // Specify custom names because default names collied with existing routes.
610
+    ])->names([// Specify custom names because default names collied with existing routes.
611 611
         'show' => 'api.jobs.show',
612 612
         'store' => 'api.jobs.store',
613 613
         'update' => 'api.jobs.update'
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
 
616 616
     Route::resource('managers', 'Api\ManagerApiController')->only([
617 617
         'show', 'update'
618
-    ])->names([ // Specify custom names because default names collied with existing routes.
618
+    ])->names([// Specify custom names because default names collied with existing routes.
619 619
         'show' => 'api.managers.show',
620 620
         'update' => 'api.managers.update'
621 621
     ]);
Please login to merge, or discard this patch.
app/Listeners/LogSuccessfulLogin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,6 +28,6 @@
 block discarded – undo
28 28
     public function handle(Login $event)
29 29
     {
30 30
         $user = $event->user;
31
-        Log::notice('Login by user {id=' . $user->id . ', email=' . $user->email . ', role=' . $user->user_role->name . '}');
31
+        Log::notice('Login by user {id='.$user->id.', email='.$user->email.', role='.$user->user_role->name.'}');
32 32
     }
33 33
 }
Please login to merge, or discard this patch.
app/Listeners/LogUserCreated.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,6 +26,6 @@
 block discarded – undo
26 26
      */
27 27
     public function handle(UserCreated $event)
28 28
     {
29
-        Log::notice('User created: ' . $event->user);
29
+        Log::notice('User created: '.$event->user);
30 30
     }
31 31
 }
Please login to merge, or discard this patch.
app/Listeners/LogUserUpdated.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,6 +26,6 @@
 block discarded – undo
26 26
      */
27 27
     public function handle(UserUpdated $event)
28 28
     {
29
-        Log::notice('User updated: ' . $event->user);
29
+        Log::notice('User updated: '.$event->user);
30 30
     }
31 31
 }
Please login to merge, or discard this patch.
app/Listeners/ApplicationStatusChanged.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,24 +31,24 @@
 block discarded – undo
31 31
 
32 32
         if (Auth::check()) {
33 33
             $user = Auth::user();
34
-            $userText = '{id=' . $user->id . ', email=' . $user->email . '}';
34
+            $userText = '{id='.$user->id.', email='.$user->email.'}';
35 35
         } else {
36 36
             $userText = '{null}';
37 37
         }
38 38
 
39 39
         // Log when application is first created
40 40
         if ($application->wasRecentlyCreated) {
41
-            $applicationText = '{id=' . $application->id . ', status=' . $application->application_status->name . '}';
41
+            $applicationText = '{id='.$application->id.', status='.$application->application_status->name.'}';
42 42
 
43
-            Log::notice('Application created: application ' . $applicationText . ' has been created by user ' . $userText);
43
+            Log::notice('Application created: application '.$applicationText.' has been created by user '.$userText);
44 44
         }
45 45
         // Log if application status has been changed
46 46
         elseif ($application->application_status_id != $application->getOriginal('application_status_id')) {
47 47
             $freshApplication = $application->fresh();
48
-            $applicationText = '{id=' . $freshApplication->id . '}';
49
-            $statusText = '{' . $freshApplication->application_status->name . '}';
48
+            $applicationText = '{id='.$freshApplication->id.'}';
49
+            $statusText = '{'.$freshApplication->application_status->name.'}';
50 50
 
51
-            Log::notice('Application status changed: application ' . $applicationText . ' has been changed to ' . $statusText . ' by user ' . $userText);
51
+            Log::notice('Application status changed: application '.$applicationText.' has been changed to '.$statusText.' by user '.$userText);
52 52
         }
53 53
     }
54 54
 }
Please login to merge, or discard this patch.
app/Console/Kernel.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      */
39 39
     protected function commands(): void
40 40
     {
41
-        $this->load(__DIR__ . '/Commands');
41
+        $this->load(__DIR__.'/Commands');
42 42
 
43 43
         require base_path('routes/console.php');
44 44
     }
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         // search $needle in process status
59 59
         $result = array_filter(
60 60
             $process_status,
61
-            function ($var) use ($needle) {
61
+            function($var) use ($needle) {
62 62
                 return strpos($var, $needle);
63 63
             }
64 64
         );
Please login to merge, or discard this patch.