@@ -30,6 +30,6 @@ |
||
30 | 30 | */ |
31 | 31 | public function assessments() // phpcs:ignore |
32 | 32 | { |
33 | - return $this->hasMany(Assessment::class); |
|
33 | + return $this->hasMany (Assessment::class); |
|
34 | 34 | } |
35 | 35 | } |
@@ -38,11 +38,11 @@ |
||
38 | 38 | |
39 | 39 | public function job_poster() //phpcs:ignore |
40 | 40 | { |
41 | - return $this->belongsTo(\App\Models\JobPoster::class); |
|
41 | + return $this->belongsTo (\App\Models\JobPoster::class); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | public function job_application_answers() //phpcs:ignore |
45 | 45 | { |
46 | - return $this->hasMany(\App\Models\JobApplicationAnswer::class, 'job_poster_questions_id'); |
|
46 | + return $this->hasMany (\App\Models\JobApplicationAnswer::class, 'job_poster_questions_id'); |
|
47 | 47 | } |
48 | 48 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | public function __construct(string $message, int $code, ?\Throwable $previous = null, array $links = null) |
26 | 26 | { |
27 | 27 | $this->links = $links; |
28 | - parent::__construct($message, $code, $previous); |
|
28 | + parent::__construct ($message, $code, $previous); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function render(\Illuminate\Http\Request $request) |
38 | 38 | { |
39 | - return response()->view( |
|
39 | + return response ()->view ( |
|
40 | 40 | 'errors/admin', |
41 | 41 | [ |
42 | 42 | 'exception' => $this, |
@@ -62,17 +62,17 @@ discard block |
||
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 | /** |
@@ -84,12 +84,12 @@ discard block |
||
84 | 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 []; |
@@ -106,14 +106,14 @@ discard block |
||
106 | 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 | /** |
@@ -125,15 +125,15 @@ discard block |
||
125 | 125 | */ |
126 | 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 | /** |
@@ -145,16 +145,16 @@ discard block |
||
145 | 145 | */ |
146 | 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 | } |
@@ -18,7 +18,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -19,7 +19,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -21,17 +21,17 @@ discard block |
||
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 |
||
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 |
||
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 |
@@ -19,7 +19,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -11,9 +11,9 @@ |
||
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 | } |