Passed
Push — task/add-manager-resource ( c74771 )
by Chris
11:48
created
app/Policies/WorkExperiencePolicy.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
      */
19 19
     public function view(User $user, WorkExperience $workExperience)
20 20
     {
21
-        return $user->isApplicant() && $workExperience->applicant->user->is($user);
21
+        return $user->isApplicant () && $workExperience->applicant->user->is ($user);
22 22
     }
23 23
 
24 24
     /**
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
      */
30 30
     public function create(User $user)
31 31
     {
32
-        return $user->isApplicant();
32
+        return $user->isApplicant ();
33 33
     }
34 34
 
35 35
     /**
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      */
42 42
     public function update(User $user, WorkExperience $workExperience)
43 43
     {
44
-        return $user->isApplicant() && $workExperience->applicant->user->is($user);
44
+        return $user->isApplicant () && $workExperience->applicant->user->is ($user);
45 45
     }
46 46
 
47 47
     /**
@@ -53,6 +53,6 @@  discard block
 block discarded – undo
53 53
      */
54 54
     public function delete(User $user, WorkExperience $workExperience)
55 55
     {
56
-        return $user->isApplicant() && $workExperience->applicant->user->is($user);
56
+        return $user->isApplicant () && $workExperience->applicant->user->is ($user);
57 57
     }
58 58
 }
Please login to merge, or discard this patch.
app/Policies/AssessmentPlanNotificationPolicy.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     public function view(User $user, AssessmentPlanNotification $notification): bool
20 20
     {
21 21
         // Managers can view notifications tied to Jobs they own.
22
-        return $user->isManager() &&
22
+        return $user->isManager () &&
23 23
             $notification->job_poster->manager->user_id === $user->id;
24 24
     }
25 25
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     public function create(User $user): bool
33 33
     {
34 34
         //Any manager can create a new AssessmentPlanNotification, but only for job posters they own.
35
-        return $user->isManager();
35
+        return $user->isManager ();
36 36
     }
37 37
 
38 38
     /**
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     public function update(User $user, AssessmentPlanNotification $notification): bool
46 46
     {
47 47
         // Managers can edit notifications tied to Jobs they own.
48
-        return $user->isManager() &&
48
+        return $user->isManager () &&
49 49
             $notification->job_poster->manager->user_id === $user->id;
50 50
     }
51 51
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     public function delete(User $user, AssessmentPlanNotification $notification) : bool
61 61
     {
62 62
         // Managers can delete notifications tied to Jobs they own.
63
-        return $user->isManager() &&
63
+        return $user->isManager () &&
64 64
             $notification->job_poster->manager->user_id === $user->id;
65 65
     }
66 66
 }
Please login to merge, or discard this patch.
app/Policies/ApplicantPolicy.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -21,17 +21,17 @@  discard block
 block discarded – undo
21 21
     {
22 22
         $applicant_id = $applicant->id;
23 23
         $user_id = $user->id;
24
-        return JobPoster::whereHas(
24
+        return JobPoster::whereHas (
25 25
             'manager',
26 26
             function ($q) use ($user_id) {
27
-                $q->where('user_id', $user_id);
27
+                $q->where ('user_id', $user_id);
28 28
             }
29
-        )->whereHas(
29
+        )->whereHas (
30 30
             'submitted_applications',
31 31
             function ($q) use ($applicant_id) {
32
-                    $q->where('applicant_id', $applicant_id);
32
+                    $q->where ('applicant_id', $applicant_id);
33 33
             }
34
-        )->get()->isNotEmpty();
34
+        )->get ()->isNotEmpty ();
35 35
     }
36 36
 
37 37
     /**
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
      */
44 44
     public function view(User $user, Applicant $applicant)
45 45
     {
46
-        $authApplicant =  $user->isApplicant() &&
47
-            $applicant->user->is($user);
48
-        $authManager = $user->isManager() && $this->ownsJobApplicantAppliedTo($user, $applicant);
46
+        $authApplicant = $user->isApplicant () &&
47
+            $applicant->user->is ($user);
48
+        $authManager = $user->isManager () && $this->ownsJobApplicantAppliedTo ($user, $applicant);
49 49
         return $authApplicant || $authManager;
50 50
     }
51 51
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public function update(User $user, Applicant $applicant)
71 71
     {
72
-        return $user->isApplicant() &&
72
+        return $user->isApplicant () &&
73 73
             $applicant->user_id === $user->id;
74 74
     }
75 75
 
Please login to merge, or discard this patch.
app/Policies/AssessmentPolicy.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     public function view(User $user, Assessment $assessment): bool
20 20
     {
21 21
         // Managers can view assessments tied to Jobs they own.
22
-        return $user->isManager() &&
22
+        return $user->isManager () &&
23 23
             $assessment->criterion->job_poster->manager->user_id === $user->id;
24 24
     }
25 25
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     public function create(User $user): bool
33 33
     {
34 34
         //Any manager can create a new Assessment, but only for criteria they own.
35
-        return $user->isManager();
35
+        return $user->isManager ();
36 36
     }
37 37
 
38 38
     /**
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     public function update(User $user, Assessment $assessment): bool
46 46
     {
47 47
         // Managers can edit assessments tied to Jobs they own.
48
-        return $user->isManager() &&
48
+        return $user->isManager () &&
49 49
             $assessment->criterion->job_poster->manager->user_id === $user->id;
50 50
     }
51 51
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     public function delete(User $user, Assessment $assessment) : bool
61 61
     {
62 62
         // Managers can delete assessments tied to Jobs they own.
63
-        return $user->isManager() &&
63
+        return $user->isManager () &&
64 64
             $assessment->criterion->job_poster->manager->user_id === $user->id;
65 65
     }
66 66
 }
Please login to merge, or discard this patch.
app/Policies/BasePolicy.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,9 +11,9 @@
 block discarded – undo
11 11
 
12 12
     public function before($user, $ability)
13 13
     {
14
-        if ($user->isAdmin()) {
14
+        if ($user->isAdmin ()) {
15 15
             $userText = '{id='.$user->id.'}';
16
-            Log::notice('User '.$userText.' has bypassed policy as an Admin');
16
+            Log::notice ('User '.$userText.' has bypassed policy as an Admin');
17 17
             return true;
18 18
         }
19 19
     }
Please login to merge, or discard this patch.
app/Policies/JobPolicy.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -21,10 +21,10 @@  discard block
 block discarded – undo
21 21
     {
22 22
         // Anyone can view a published job
23 23
         // Only the manager that created it can view an unpublished job
24
-        return $jobPoster->status() == 'published' || $jobPoster->status() == 'closed' ||
24
+        return $jobPoster->status () == 'published' || $jobPoster->status () == 'closed' ||
25 25
         (
26 26
             $user &&
27
-            $user->isManager() &&
27
+            $user->isManager () &&
28 28
             $jobPoster->manager->user_id == $user->id
29 29
         );
30 30
     }
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     public function create(User $user)
39 39
     {
40 40
         // Any manager can create a new job poster.
41
-        return $user->isManager();
41
+        return $user->isManager ();
42 42
     }
43 43
 
44 44
     /**
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     public function update(User $user, JobPoster $jobPoster)
52 52
     {
53 53
         // Only managers can edit jobs, and only their own, managers can't publish jobs or edit published jobs
54
-        return $user->isManager() &&
54
+        return $user->isManager () &&
55 55
         $jobPoster->manager->user->id == $user->id &&
56 56
         !$jobPoster->published;
57 57
     }
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     {
69 69
         // Jobs can only be deleted when they're in the 'draft'
70 70
         // state, and only by managers that created them.
71
-        return $user->isManager() &&
71
+        return $user->isManager () &&
72 72
         $jobPoster->manager->user->id == $user->id &&
73 73
         !$jobPoster->published;
74 74
     }
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
     {
85 85
         // Only upgradedManagers can submit jobs for review, only their own jobs, and only if they're still drafts.
86 86
         // NOTE: this is one of the only permissions to require an upgradedManager, as opposed to a demoManager.var
87
-        return $user->isUpgradedManager() &&
87
+        return $user->isUpgradedManager () &&
88 88
             $jobPoster->manager->user->id == $user->id &&
89
-            $jobPoster->status() === 'draft';
89
+            $jobPoster->status () === 'draft';
90 90
     }
91 91
     /**
92 92
      * Determine whether the user can review applications to the job poster.
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
     public function reviewApplicationsFor(User $user, JobPoster $jobPoster)
99 99
     {
100 100
         // Only managers can review applications, and only for their own jobs.
101
-        return $user->isManager() &&
101
+        return $user->isManager () &&
102 102
             $jobPoster->manager->user->id == $user->id &&
103
-            $jobPoster->isClosed();
103
+            $jobPoster->isClosed ();
104 104
     }
105 105
 }
Please login to merge, or discard this patch.
app/Policies/SkillDeclarationPolicy.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
      */
19 19
     public function view(User $user, SkillDeclaration $skillDeclaration)
20 20
     {
21
-        return ($user->isApplicant() && $skillDeclaration->applicant->user->is($user));
21
+        return ($user->isApplicant () && $skillDeclaration->applicant->user->is ($user));
22 22
     }
23 23
 
24 24
     /**
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
      */
30 30
     public function create(User $user)
31 31
     {
32
-        return $user->isApplicant();
32
+        return $user->isApplicant ();
33 33
     }
34 34
 
35 35
     /**
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      */
42 42
     public function update(User $user, SkillDeclaration $skillDeclaration)
43 43
     {
44
-        return ($user->isApplicant() && $skillDeclaration->applicant->user->is($user));
44
+        return ($user->isApplicant () && $skillDeclaration->applicant->user->is ($user));
45 45
     }
46 46
 
47 47
     /**
@@ -53,6 +53,6 @@  discard block
 block discarded – undo
53 53
      */
54 54
     public function delete(User $user, SkillDeclaration $skillDeclaration)
55 55
     {
56
-        return ($user->isApplicant() && $skillDeclaration->applicant->user->is($user));
56
+        return ($user->isApplicant () && $skillDeclaration->applicant->user->is ($user));
57 57
     }
58 58
 }
Please login to merge, or discard this patch.
app/Policies/RatingGuideQuestionPolicy.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     public function view(User $user, RatingGuideQuestion $question): bool
20 20
     {
21 21
         // Managers can view questions tied to Jobs they own.
22
-        return $user->isManager() &&
22
+        return $user->isManager () &&
23 23
             $question->job_poster->manager->user_id === $user->id;
24 24
     }
25 25
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     public function create(User $user): bool
33 33
     {
34 34
         //Any manager can create a new RatingGuideQuestion, but only for jobs they own.
35
-        return $user->isManager();
35
+        return $user->isManager ();
36 36
     }
37 37
 
38 38
     /**
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     public function update(User $user, RatingGuideQuestion $question): bool
46 46
     {
47 47
         // Managers can edit questions tied to Jobs they own.
48
-        return $user->isManager() &&
48
+        return $user->isManager () &&
49 49
             $question->job_poster->manager->user_id === $user->id;
50 50
     }
51 51
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     public function delete(User $user, RatingGuideQuestion $question) : bool
61 61
     {
62 62
         // Managers can delete questions tied to Jobs they own.
63
-        return $user->isManager() &&
63
+        return $user->isManager () &&
64 64
             $question->job_poster->manager->user_id === $user->id;
65 65
     }
66 66
 }
Please login to merge, or discard this patch.
app/Policies/ManagerPolicy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
     public function update(User $user, Manager $manager)
44 44
     {
45 45
         //Mangers can only update their own profiles
46
-        return $user->isManager() &&
46
+        return $user->isManager () &&
47 47
             $manager->user_id == $user->id;
48 48
     }
49 49
 
Please login to merge, or discard this patch.