Passed
Push — feature/add-2fa-support ( f7b805...d20abf )
by Grant
18:01 queued 08:21
created
database/factories/JobPosterQuestionFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,9 +5,9 @@
 block discarded – undo
5 5
 
6 6
 $faker_fr = Faker\Factory::create('fr');
7 7
 
8
-$factory->define(JobPosterQuestion::class, function (Faker\Generator $faker) use ($faker_fr) {
8
+$factory->define(JobPosterQuestion::class, function(Faker\Generator $faker) use ($faker_fr) {
9 9
     return [
10
-        'job_poster_id' => function () {
10
+        'job_poster_id' => function() {
11 11
             return factory(JobPoster::class)->create()->id;
12 12
         },
13 13
         'description:en' => $faker->sentence(),
Please login to merge, or discard this patch.
database/factories/RatingGuideAnswerFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,9 +5,9 @@
 block discarded – undo
5 5
 use App\Models\Skill;
6 6
 use App\Models\Criteria;
7 7
 
8
-$factory->define(RatingGuideAnswer::class, function (Faker\Generator $faker) {
8
+$factory->define(RatingGuideAnswer::class, function(Faker\Generator $faker) {
9 9
     return [
10
-        'rating_guide_question_id' => function () {
10
+        'rating_guide_question_id' => function() {
11 11
             return factory(RatingGuideQuestion::class)->create()->id;
12 12
         },
13 13
         'criterion_id' => null,
Please login to merge, or discard this patch.
database/factories/TeamCultureFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 use App\Models\TeamCulture;
6 6
 use App\Models\Manager;
7 7
 
8
-$factory->define(TeamCulture::class, function (Faker $faker) {
8
+$factory->define(TeamCulture::class, function(Faker $faker) {
9 9
     $faker_fr = FakerFactory::create('fr');
10 10
     return [
11 11
         'team_size' => $faker->numberBetween(5, 15),
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
         'operating_context:fr' => $faker_fr->paragraph(),
19 19
         'what_we_value:fr' => $faker_fr->paragraph(),
20 20
         'how_we_work:fr' => $faker_fr->paragraph(),
21
-        'manager_id' => function () {
21
+        'manager_id' => function() {
22 22
             return factory(Manager::class)->create()->id;
23 23
         }
24 24
     ];
Please login to merge, or discard this patch.
app/Services/WhichPortal.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,9 +56,9 @@
 block discarded – undo
56 56
         if (WhichPortal::isApplicantPortal()) {
57 57
             return $routeName;
58 58
         } elseif (WhichPortal::isManagerPortal()) {
59
-            return 'manager.' . $routeName;
59
+            return 'manager.'.$routeName;
60 60
         } elseif (WhichPortal::isAdminPortal()) {
61
-            return 'admin.' . $routeName;
61
+            return 'admin.'.$routeName;
62 62
         }
63 63
         return $routeName;
64 64
     }
Please login to merge, or discard this patch.
app/Traits/RememberDeviceTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
      */
21 21
     public function getRememberDeviceToken()
22 22
     {
23
-        if (! empty($this->getRememberDeviceTokenName())) {
24
-            return (string) $this->{$this->getRememberDeviceTokenName()};
23
+        if (!empty($this->getRememberDeviceTokenName())) {
24
+            return (string)$this->{$this->getRememberDeviceTokenName()};
25 25
         }
26 26
     }
27 27
 
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      */
34 34
     public function setRememberDeviceToken($value)
35 35
     {
36
-        if (! empty($this->getRememberDeviceTokenName())) {
36
+        if (!empty($this->getRememberDeviceTokenName())) {
37 37
             // Make sure new value is immediately saved to db, as well as to model object.
38 38
             $this->where('id', $this->id)->update([$this->getRememberDeviceTokenName() => $value]);
39 39
             $this->{$this->getRememberDeviceTokenName()} = $value;
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.