Passed
Push — task/add-manager-resource ( c74771 )
by Chris
11:48
created
app/Policies/RatingGuideAnswerPolicy.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, RatingGuideAnswer $answer): bool
20 20
     {
21 21
         // Managers can view answers tied to Jobs they own.
22
-        return $user->isManager() &&
22
+        return $user->isManager () &&
23 23
             $answer->rating_guide_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 RatingGuideAnswer, but only for questions 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, RatingGuideAnswer $answer): bool
46 46
     {
47 47
         // Managers can edit answers tied to Jobs they own.
48
-        return $user->isManager() &&
48
+        return $user->isManager () &&
49 49
             $answer->rating_guide_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, RatingGuideAnswer $answer) : bool
61 61
     {
62 62
         // Managers can delete answers tied to Jobs they own.
63
-        return $user->isManager() &&
63
+        return $user->isManager () &&
64 64
             $answer->rating_guide_question->job_poster->manager->user_id === $user->id;
65 65
     }
66 66
 }
Please login to merge, or discard this patch.
app/Policies/ReferencePolicy.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, Reference $reference)
20 20
     {
21
-        return $user->isApplicant() && $reference->applicant->user->is($user);
21
+        return $user->isApplicant () && $reference->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, Reference $reference)
43 43
     {
44
-        return $user->isApplicant() && $reference->applicant->user->is($user);
44
+        return $user->isApplicant () && $reference->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, Reference $reference)
55 55
     {
56
-        return $user->isApplicant() && $reference->applicant->user->is($user);
56
+        return $user->isApplicant () && $reference->applicant->user->is ($user);
57 57
     }
58 58
 }
Please login to merge, or discard this patch.
app/Policies/CoursePolicy.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, Course $course)
20 20
     {
21
-        return $user->isApplicant() && $course->applicant->user->is($user);
21
+        return $user->isApplicant () && $course->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, Course $course)
43 43
     {
44
-        return $user->isApplicant() && $course->applicant->user->is($user);
44
+        return $user->isApplicant () && $course->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, Course $course)
55 55
     {
56
-        return $user->isApplicant() && $course->applicant->user->is($user);
56
+        return $user->isApplicant () && $course->applicant->user->is ($user);
57 57
     }
58 58
 }
Please login to merge, or discard this patch.
app/Policies/ApplicationPolicy.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -20,12 +20,12 @@  discard block
 block discarded – undo
20 20
      */
21 21
     public function view(User $user, JobApplication $jobApplication)
22 22
     {
23
-        $authApplicant = ($user->isApplicant() &&
23
+        $authApplicant = ($user->isApplicant () &&
24 24
             $user->applicant->id === $jobApplication->applicant_id);
25
-        $authManager = ($user->isManager() &&
26
-            $jobApplication->job_poster->manager->user->is($user));
25
+        $authManager = ($user->isManager () &&
26
+            $jobApplication->job_poster->manager->user->is ($user));
27 27
 
28
-        return $authApplicant||$authManager;
28
+        return $authApplicant || $authManager;
29 29
     }
30 30
 
31 31
     /**
@@ -48,10 +48,10 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public function update(User $user, JobApplication $jobApplication)
50 50
     {
51
-        return $user->isApplicant() &&
51
+        return $user->isApplicant () &&
52 52
             $user->applicant->id === $jobApplication->applicant_id &&
53 53
             $jobApplication->application_status->name == 'draft' &&
54
-            $jobApplication->job_poster->isOpen();
54
+            $jobApplication->job_poster->isOpen ();
55 55
     }
56 56
 
57 57
     /**
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      */
64 64
     public function delete(User $user, JobApplication $jobApplication)
65 65
     {
66
-        return $user->isApplicant() &&
66
+        return $user->isApplicant () &&
67 67
             $user->applicant->id === $jobApplication->applicant_id &&
68 68
             $jobApplication->application_status->name == 'draft';
69 69
     }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     {
80 80
         // Only the manager in charge of the accompanying job can review an application,
81 81
         // and only if it has been submitted
82
-        return $user->isManager() &&
82
+        return $user->isManager () &&
83 83
             $jobApplication->job_poster->manager->user->id == $user->id &&
84 84
             $jobApplication->application_status->name != 'draft';
85 85
     }
Please login to merge, or discard this patch.
app/Policies/WorkSamplePolicy.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, WorkSample $workSample)
20 20
     {
21
-        return $user->isApplicant() && $workSample->applicant->user->is($user);
21
+        return $user->isApplicant () && $workSample->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, WorkSample $workSample)
43 43
     {
44
-        return $user->isApplicant() && $workSample->applicant->user->is($user);
44
+        return $user->isApplicant () && $workSample->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, WorkSample $workSample)
55 55
     {
56
-        return $user->isApplicant() && $workSample->applicant->user->is($user);
56
+        return $user->isApplicant () && $workSample->applicant->user->is ($user);
57 57
     }
58 58
 }
Please login to merge, or discard this patch.
app/Helpers/Helper.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 use Illuminate\Support\Facades\Config;
6 6
 use Illuminate\Support\Facades\Lang;
7 7
 
8
-if (!function_exists('humanizeDate')) {
8
+if (!function_exists ('humanizeDate')) {
9 9
     /**
10 10
      * Computes a human readable localized date.
11 11
      *
@@ -15,17 +15,17 @@  discard block
 block discarded – undo
15 15
      */
16 16
     function humanizeDate(Date $datetime) : string
17 17
     {
18
-        $dateFormat = Config::get('app.date_format');
19
-        $locale = App::getLocale();
20
-        $timezone = Config::get('app.local_timezone');
18
+        $dateFormat = Config::get ('app.date_format');
19
+        $locale = App::getLocale ();
20
+        $timezone = Config::get ('app.local_timezone');
21 21
 
22
-        $datetime->setTimezone(new \DateTimeZone($timezone));
22
+        $datetime->setTimezone (new \DateTimeZone ($timezone));
23 23
 
24
-        return $datetime->format($dateFormat[$locale]);
24
+        return $datetime->format ($dateFormat[$locale]);
25 25
     }
26 26
 }
27 27
 
28
-if (!function_exists('humanizeTime')) {
28
+if (!function_exists ('humanizeTime')) {
29 29
     /**
30 30
      * Computes a human readable localized time.
31 31
      *
@@ -35,23 +35,23 @@  discard block
 block discarded – undo
35 35
      */
36 36
     function humanizeTime(Date $datetime) : string
37 37
     {
38
-        $timeFormat = Config::get('app.time_format');
39
-        $locale = App::getLocale();
40
-        $timezone = Config::get('app.local_timezone');
38
+        $timeFormat = Config::get ('app.time_format');
39
+        $locale = App::getLocale ();
40
+        $timezone = Config::get ('app.local_timezone');
41 41
 
42
-        $datetime->setTimezone(new \DateTimeZone($timezone));
42
+        $datetime->setTimezone (new \DateTimeZone ($timezone));
43 43
 
44
-        $displayTime = $datetime->format($timeFormat[$locale]);
44
+        $displayTime = $datetime->format ($timeFormat[$locale]);
45 45
 
46 46
         if ($locale == 'fr') {
47
-            $displayTime = str_replace(['EST', 'EDT'], ['HNE', 'HAE'], $displayTime);
47
+            $displayTime = str_replace (['EST', 'EDT'], ['HNE', 'HAE'], $displayTime);
48 48
         }
49 49
 
50 50
         return $displayTime;
51 51
     }
52 52
 }
53 53
 
54
-if (!function_exists('humanizeDateDiff')) {
54
+if (!function_exists ('humanizeDateDiff')) {
55 55
     /**
56 56
      * Computes a human readable time difference between two dates.
57 57
      *
@@ -63,9 +63,9 @@  discard block
 block discarded – undo
63 63
     function humanizeDateDiff(Date $datetime, Date $origin = null) : string
64 64
     {
65 65
         if (!isset($origin)) {
66
-            $origin = new Date();
66
+            $origin = new Date ();
67 67
         }
68
-        $interval = $datetime->diff($origin);
68
+        $interval = $datetime->diff ($origin);
69 69
 
70 70
         $d = $interval->d;
71 71
         $h = $interval->h;
@@ -88,11 +88,11 @@  discard block
 block discarded – undo
88 88
 
89 89
         $key = "common/time.$unit";
90 90
 
91
-        return Lang::choice($key, $count);
91
+        return Lang::choice ($key, $count);
92 92
     }
93 93
 }
94 94
 
95
-if (!function_exists('humanizeLastDay')) {
95
+if (!function_exists ('humanizeLastDay')) {
96 96
     /**
97 97
      * Returns the date of the last full day a person has before a deadline time.
98 98
      *
@@ -102,13 +102,13 @@  discard block
 block discarded – undo
102 102
      */
103 103
     function humanizeLastDay(Date $datetime) : string
104 104
     {
105
-        $lastday = $datetime->sub('1 day');
105
+        $lastday = $datetime->sub ('1 day');
106 106
 
107
-        return humanizeDate($lastday);
107
+        return humanizeDate ($lastday);
108 108
     }
109 109
 }
110 110
 
111
-if (!function_exists('ptDayStartToUtcTime')) {
111
+if (!function_exists ('ptDayStartToUtcTime')) {
112 112
     /**
113 113
      * Given a date, creates a datetime object representing the start of day
114 114
      * in the most Western timezone in Canada (America/Vancouver).
@@ -119,19 +119,19 @@  discard block
 block discarded – undo
119 119
      */
120 120
     function ptDayStartToUtcTime(string $date) : Date
121 121
     {
122
-        $jobTimezone = Config::get('app.job_timezone');
123
-        $dbTimezone = Config::get('app.timezone');
122
+        $jobTimezone = Config::get ('app.job_timezone');
123
+        $dbTimezone = Config::get ('app.timezone');
124 124
         // Create a new date that's the beginning of the day in
125 125
         // Pacific Daylight/Standard Time.
126
-        $date = new Date("$date 00:00:00", new \DateTimeZone($jobTimezone));
126
+        $date = new Date ("$date 00:00:00", new \DateTimeZone ($jobTimezone));
127 127
         // Convert to UTC for correct offset.
128
-        $date->setTimezone($dbTimezone);
128
+        $date->setTimezone ($dbTimezone);
129 129
 
130 130
         return $date;
131 131
     }
132 132
 }
133 133
 
134
-if (!function_exists('ptDayEndToUtcTime')) {
134
+if (!function_exists ('ptDayEndToUtcTime')) {
135 135
     /**
136 136
      * Given a date, creates a datetime object representing the start of day
137 137
      * in the most Western timezone in Canada (America/Vancouver).
@@ -142,13 +142,13 @@  discard block
 block discarded – undo
142 142
      */
143 143
     function ptDayEndToUtcTime(string $date) : Date
144 144
     {
145
-        $jobTimezone = Config::get('app.job_timezone');
146
-        $dbTimezone = Config::get('app.timezone');
145
+        $jobTimezone = Config::get ('app.job_timezone');
146
+        $dbTimezone = Config::get ('app.timezone');
147 147
         // Create a new date that's the beginning of the day in
148 148
         // Pacific Daylight/Standard Time.
149
-        $date = new Date("$date 23:59:59", new \DateTimeZone($jobTimezone));
149
+        $date = new Date ("$date 23:59:59", new \DateTimeZone ($jobTimezone));
150 150
         // Convert to UTC for correct offset.
151
-        $date->setTimezone($dbTimezone);
151
+        $date->setTimezone ($dbTimezone);
152 152
 
153 153
         return $date;
154 154
     }
Please login to merge, or discard this patch.
app/Mail/JobPosterReviewRequested.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,6 +56,6 @@
 block discarded – undo
56 56
      */
57 57
     public function build()
58 58
     {
59
-        return $this->text('emails.job_posters.review_requested_plain');
59
+        return $this->text ('emails.job_posters.review_requested_plain');
60 60
     }
61 61
 }
Please login to merge, or discard this patch.
database/seeds/JobPosterSeeder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,6 +12,6 @@
 block discarded – undo
12 12
      */
13 13
     public function run()
14 14
     {
15
-        factory(JobPoster::class, 5)->create();
15
+        factory (JobPoster::class, 5)->create ();
16 16
     }
17 17
 }
Please login to merge, or discard this patch.
database/seeds/DatabaseSeeder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
      */
12 12
     public function run()
13 13
     {
14
-        $this->call([
14
+        $this->call ([
15 15
             DevSeeder::class,
16 16
             SkillClassificationSeeder::class
17 17
         ]);
Please login to merge, or discard this patch.