@@ -11,10 +11,10 @@ discard block |
||
11 | 11 | * |
12 | 12 | * @return boolean |
13 | 13 | */ |
14 | - public function authorize() : bool |
|
14 | + public function authorize () : bool |
|
15 | 15 | { |
16 | 16 | // Only allow updates if the user is a logged in Admin. |
17 | - return backpack_auth()->check(); |
|
17 | + return backpack_auth ()->check (); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | * |
23 | 23 | * @return string[] |
24 | 24 | */ |
25 | - public function rules() : array |
|
25 | + public function rules () : array |
|
26 | 26 | { |
27 | 27 | return [ |
28 | 28 | 'key' => 'required|size:2|alpha|unique:classifications,key' |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * |
35 | 35 | * @return string[] |
36 | 36 | */ |
37 | - public function messages() : array |
|
37 | + public function messages () : array |
|
38 | 38 | { |
39 | 39 | return [ |
40 | 40 | 'key.required' => 'Please enter a classification key.', |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * |
12 | 12 | * @return boolean |
13 | 13 | */ |
14 | - public function authorize(): bool |
|
14 | + public function authorize (): bool |
|
15 | 15 | { |
16 | 16 | return true; |
17 | 17 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @return string[] |
23 | 23 | */ |
24 | - public function rules(): array |
|
24 | + public function rules (): array |
|
25 | 25 | { |
26 | 26 | return [ |
27 | 27 | '*.id' => 'present', |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | * |
17 | 17 | * @return bool |
18 | 18 | */ |
19 | - public function authorize() |
|
19 | + public function authorize () |
|
20 | 20 | { |
21 | 21 | return true; |
22 | 22 | } |
@@ -26,11 +26,11 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @return array |
28 | 28 | */ |
29 | - public function rules() |
|
29 | + public function rules () |
|
30 | 30 | { |
31 | - $frequencyRule = new ValidIdRule(Frequency::class); |
|
31 | + $frequencyRule = new ValidIdRule (Frequency::class); |
|
32 | 32 | return [ |
33 | - 'department_id' => ['nullable', new ValidIdRule(Department::class)], |
|
33 | + 'department_id' => ['nullable', new ValidIdRule (Department::class)], |
|
34 | 34 | 'gov_email' => [ |
35 | 35 | 'nullable', |
36 | 36 | 'string', |
@@ -15,14 +15,14 @@ discard block |
||
15 | 15 | * |
16 | 16 | * @return bool |
17 | 17 | */ |
18 | - public function authorize() |
|
18 | + public function authorize () |
|
19 | 19 | { |
20 | 20 | // Ensure the user can make answers, question exists, and user is the owner of the question it answers. |
21 | - if ($this->user()->can('create', RatingGuideAnswer::class)) { |
|
22 | - $questionId = (int) $this->input('rating_guide_question_id'); |
|
21 | + if ($this->user ()->can ('create', RatingGuideAnswer::class)) { |
|
22 | + $questionId = (int) $this->input ('rating_guide_question_id'); |
|
23 | 23 | if ($questionId) { |
24 | - $question = RatingGuideQuestion::find($questionId); |
|
25 | - return $question && $this->user()->can('update', $question); |
|
24 | + $question = RatingGuideQuestion::find ($questionId); |
|
25 | + return $question && $this->user ()->can ('update', $question); |
|
26 | 26 | } |
27 | 27 | } |
28 | 28 | |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | * |
35 | 35 | * @return array |
36 | 36 | */ |
37 | - public function rules() |
|
37 | + public function rules () |
|
38 | 38 | { |
39 | 39 | return [ |
40 | - 'rating_guide_question_id' => ['required', new ValidIdRule(RatingGuideQuestion::class)], |
|
41 | - 'criterion_id' => ['nullable', new ValidIdRule(Criteria::class)], |
|
40 | + 'rating_guide_question_id' => ['required', new ValidIdRule (RatingGuideQuestion::class)], |
|
41 | + 'criterion_id' => ['nullable', new ValidIdRule (Criteria::class)], |
|
42 | 42 | 'expected_answer' => 'nullable|string', |
43 | 43 | ]; |
44 | 44 | } |
@@ -11,10 +11,10 @@ discard block |
||
11 | 11 | * |
12 | 12 | * @return boolean |
13 | 13 | */ |
14 | - public function authorize() : bool |
|
14 | + public function authorize () : bool |
|
15 | 15 | { |
16 | 16 | // Only allow updates if the user is a logged in Admin. |
17 | - return backpack_auth()->check(); |
|
17 | + return backpack_auth ()->check (); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |
@@ -22,10 +22,10 @@ discard block |
||
22 | 22 | * |
23 | 23 | * @return string[] |
24 | 24 | */ |
25 | - public function rules() : array |
|
25 | + public function rules () : array |
|
26 | 26 | { |
27 | 27 | return [ |
28 | - 'name' => 'required|unique_translation:skills,name' . (isset($this->id) ? ",{$this->id}" : ''), |
|
28 | + 'name' => 'required|unique_translation:skills,name'.(isset($this->id) ? ",{$this->id}" : ''), |
|
29 | 29 | 'description' => 'required', |
30 | 30 | 'skill_type_id' => 'exists:skill_types,id' |
31 | 31 | ]; |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * |
37 | 37 | * @return string[] |
38 | 38 | */ |
39 | - public function messages() : array |
|
39 | + public function messages () : array |
|
40 | 40 | { |
41 | 41 | return [ |
42 | 42 | 'name.required' => 'Please enter a Skill name.', |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @return boolean |
28 | 28 | */ |
29 | - public function authorize() |
|
29 | + public function authorize () |
|
30 | 30 | { |
31 | 31 | return $this->manager !== null; |
32 | 32 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * |
37 | 37 | * @return void |
38 | 38 | */ |
39 | - protected function failedValidation(\Illuminate\Contracts\Validation\Validator $validator) |
|
39 | + protected function failedValidation (\Illuminate\Contracts\Validation\Validator $validator) |
|
40 | 40 | { |
41 | 41 | $this->validator = $validator; |
42 | 42 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * |
47 | 47 | * @return array |
48 | 48 | */ |
49 | - public function rules() |
|
49 | + public function rules () |
|
50 | 50 | { |
51 | 51 | return [ |
52 | 52 | 'first_name' => 'required|string|max:191', |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | 'email', |
59 | 59 | // Email may match existing email for this user, |
60 | 60 | // but must be unique if changed. |
61 | - Rule::unique('users', 'email')->ignore($this->manager->user->id) |
|
61 | + Rule::unique ('users', 'email')->ignore ($this->manager->user->id) |
|
62 | 62 | ], |
63 | 63 | 'gov_email' => [ |
64 | 64 | 'nullable', |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | 'confirmed' |
80 | 80 | ], |
81 | 81 | |
82 | - 'department_id' => ['required', new ValidIdRule(Department::class)], |
|
82 | + 'department_id' => ['required', new ValidIdRule (Department::class)], |
|
83 | 83 | |
84 | 84 | 'years_experience' => 'nullable|numeric|min:0', |
85 | 85 | 'gc_directory_url' => 'nullable|url', |
@@ -14,10 +14,10 @@ |
||
14 | 14 | * @param \Closure $next |
15 | 15 | * @return mixed |
16 | 16 | */ |
17 | - public function handle($request, Closure $next) |
|
17 | + public function handle ($request, Closure $next) |
|
18 | 18 | { |
19 | - Date::setLocale(app()->getLocale()); |
|
19 | + Date::setLocale (app ()->getLocale ()); |
|
20 | 20 | |
21 | - return $next($request); |
|
21 | + return $next ($request); |
|
22 | 22 | } |
23 | 23 | } |
@@ -12,15 +12,15 @@ |
||
12 | 12 | * @param \Closure $next |
13 | 13 | * @return mixed |
14 | 14 | */ |
15 | - public function handle($request, Closure $next) |
|
15 | + public function handle ($request, Closure $next) |
|
16 | 16 | { |
17 | - $user = $request->user(); |
|
17 | + $user = $request->user (); |
|
18 | 18 | |
19 | - if ($user !== null && $user->isManager() && !$user->isGovIdentityConfirmed()) { |
|
20 | - $request->session()->put('url.expected', $request->url()); |
|
21 | - return redirect(route('manager.first_visit')); |
|
19 | + if ($user !== null && $user->isManager () && !$user->isGovIdentityConfirmed ()) { |
|
20 | + $request->session ()->put ('url.expected', $request->url ()); |
|
21 | + return redirect (route ('manager.first_visit')); |
|
22 | 22 | } |
23 | 23 | |
24 | - return $next($request); |
|
24 | + return $next ($request); |
|
25 | 25 | } |
26 | 26 | } |
@@ -20,9 +20,9 @@ discard block |
||
20 | 20 | * |
21 | 21 | * @return bool [description] |
22 | 22 | */ |
23 | - private function checkIfUserIsAdmin($user) |
|
23 | + private function checkIfUserIsAdmin ($user) |
|
24 | 24 | { |
25 | - return ($user->isAdmin()); |
|
25 | + return ($user->isAdmin ()); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -32,12 +32,12 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @return [type] [description] |
34 | 34 | */ |
35 | - private function respondToUnauthorizedRequest($request) |
|
35 | + private function respondToUnauthorizedRequest ($request) |
|
36 | 36 | { |
37 | - if ($request->ajax() || $request->wantsJson()) { |
|
38 | - return response(trans('backpack::base.unauthorized'), 401); |
|
37 | + if ($request->ajax () || $request->wantsJson ()) { |
|
38 | + return response (trans ('backpack::base.unauthorized'), 401); |
|
39 | 39 | } else { |
40 | - return redirect()->guest(backpack_url('login')); |
|
40 | + return redirect ()->guest (backpack_url ('login')); |
|
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
@@ -49,16 +49,16 @@ discard block |
||
49 | 49 | * |
50 | 50 | * @return mixed |
51 | 51 | */ |
52 | - public function handle($request, Closure $next) |
|
52 | + public function handle ($request, Closure $next) |
|
53 | 53 | { |
54 | - if (backpack_auth()->guest()) { |
|
55 | - return $this->respondToUnauthorizedRequest($request); |
|
54 | + if (backpack_auth ()->guest ()) { |
|
55 | + return $this->respondToUnauthorizedRequest ($request); |
|
56 | 56 | } |
57 | 57 | |
58 | - if (!$this->checkIfUserIsAdmin(backpack_user())) { |
|
59 | - return $this->respondToUnauthorizedRequest($request); |
|
58 | + if (!$this->checkIfUserIsAdmin (backpack_user ())) { |
|
59 | + return $this->respondToUnauthorizedRequest ($request); |
|
60 | 60 | } |
61 | 61 | |
62 | - return $next($request); |
|
62 | + return $next ($request); |
|
63 | 63 | } |
64 | 64 | } |