@@ -11,9 +11,9 @@ |
||
11 | 11 | * |
12 | 12 | * @return boolean |
13 | 13 | */ |
14 | - public function authorize(): bool |
|
14 | + public function authorize (): bool |
|
15 | 15 | { |
16 | 16 | // The STORE job poster method requires the user's manager id. |
17 | - return $this->user()->manager !== null; |
|
17 | + return $this->user ()->manager !== null; |
|
18 | 18 | } |
19 | 19 | } |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | * |
16 | 16 | * @return boolean |
17 | 17 | */ |
18 | - public function authorize(): bool |
|
18 | + public function authorize (): bool |
|
19 | 19 | { |
20 | 20 | return true; |
21 | 21 | } |
@@ -25,13 +25,13 @@ discard block |
||
25 | 25 | * |
26 | 26 | * @return string[] |
27 | 27 | */ |
28 | - public function rules(): array |
|
28 | + public function rules (): array |
|
29 | 29 | { |
30 | 30 | return [ |
31 | 31 | '*.id' => 'present', |
32 | - '*.criteria_type_id' => ['required', new ValidIdRule(CriteriaType::class)], |
|
33 | - '*.skill_id' => ['required', new ValidIdRule(Skill::class)], |
|
34 | - '*.skill_level_id' => ['required', new ValidIdRule(SkillLevel::class)], |
|
32 | + '*.criteria_type_id' => ['required', new ValidIdRule (CriteriaType::class)], |
|
33 | + '*.skill_id' => ['required', new ValidIdRule (Skill::class)], |
|
34 | + '*.skill_level_id' => ['required', new ValidIdRule (SkillLevel::class)], |
|
35 | 35 | '*.en.description' => 'nullable|string', |
36 | 36 | '*.en.specificity' => 'nullable|string', |
37 | 37 | '*.fr.description' => 'nullable|string', |
@@ -13,14 +13,14 @@ discard block |
||
13 | 13 | * |
14 | 14 | * @return bool |
15 | 15 | */ |
16 | - public function authorize() |
|
16 | + public function authorize () |
|
17 | 17 | { |
18 | 18 | // originalParameter avoids type hinting that automagically transforms the id into the RatingGuideAnswer object |
19 | 19 | //$answer = RatingGuideAnswer::find($this->route()->originalParameter('ratingGuideAnswer')); |
20 | 20 | |
21 | 21 | // The id parameter in the route is typehinted to magically become a RatingGuideAnswer object. |
22 | - $answer = $this->route('ratingGuideAnswer'); |
|
23 | - return $answer && $this->user()->can('update', $answer); |
|
22 | + $answer = $this->route ('ratingGuideAnswer'); |
|
23 | + return $answer && $this->user ()->can ('update', $answer); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
@@ -28,12 +28,12 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @return array |
30 | 30 | */ |
31 | - public function rules() |
|
31 | + public function rules () |
|
32 | 32 | { |
33 | 33 | return [ |
34 | 34 | // RatingGuideQUestionId shouldn't be updated after creation |
35 | 35 | //'rating_guide_question_id' => ['required', new RatingGuideQuestionRule()], |
36 | - 'criterion_id' => ['nullable', new ValidIdRule(Criteria::class)], |
|
36 | + 'criterion_id' => ['nullable', new ValidIdRule (Criteria::class)], |
|
37 | 37 | 'expected_answer' => 'nullable|string', |
38 | 38 | ]; |
39 | 39 | } |
@@ -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.', |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | * |
23 | 23 | * @return boolean |
24 | 24 | */ |
25 | - public function authorize(): bool |
|
25 | + public function authorize (): bool |
|
26 | 26 | { |
27 | - $job = $this->route('job'); |
|
27 | + $job = $this->route ('job'); |
|
28 | 28 | // Published jobs cannot be updated. |
29 | 29 | return $job && $job->published_at === null; |
30 | 30 | } |
@@ -34,25 +34,25 @@ discard block |
||
34 | 34 | * |
35 | 35 | * @return string[] |
36 | 36 | */ |
37 | - public function rules(): array |
|
37 | + public function rules (): array |
|
38 | 38 | { |
39 | - $dateFormat = Config::get('app.api_datetime_format'); |
|
39 | + $dateFormat = Config::get ('app.api_datetime_format'); |
|
40 | 40 | $dateFormatRule = "date_format:$dateFormat"; |
41 | 41 | $sliderRule = 'between:1,4'; |
42 | 42 | return [ |
43 | - 'chosen_lang' => ['nullable', Rule::in(['en', 'fr'])], |
|
43 | + 'chosen_lang' => ['nullable', Rule::in (['en', 'fr'])], |
|
44 | 44 | 'term_qty' => 'nullable|numeric', |
45 | 45 | 'open_date_time' =>['nullable', $dateFormatRule], |
46 | 46 | 'close_date_time' => ['nullable', $dateFormatRule], |
47 | 47 | 'start_date_time' =>['nullable', $dateFormatRule], |
48 | - 'department_id' => ['nullable', new ValidIdRule(Department::class)], |
|
49 | - 'province_id' => ['nullable', new ValidIdRule(Province::class)], |
|
50 | - 'security_clearance_id' => ['nullable', new ValidIdRule(SecurityClearance::class)], |
|
51 | - 'language_requirement_id' => ['nullable', new ValidIdRule(LanguageRequirement::class)], |
|
48 | + 'department_id' => ['nullable', new ValidIdRule (Department::class)], |
|
49 | + 'province_id' => ['nullable', new ValidIdRule (Province::class)], |
|
50 | + 'security_clearance_id' => ['nullable', new ValidIdRule (SecurityClearance::class)], |
|
51 | + 'language_requirement_id' => ['nullable', new ValidIdRule (LanguageRequirement::class)], |
|
52 | 52 | 'salary_min' => 'nullable|numeric', |
53 | 53 | 'salary_max' => 'nullable|numeric', |
54 | 54 | 'noc' => 'nullable|numeric', |
55 | - 'classification_id' => ['nullable', new ValidIdRule(Classification::class)], |
|
55 | + 'classification_id' => ['nullable', new ValidIdRule (Classification::class)], |
|
56 | 56 | 'classification_level' => 'nullable|numeric', |
57 | 57 | 'remote_work_allowed' => 'nullable|boolean', |
58 | 58 | 'team_size' => 'nullable|numeric', |
@@ -63,10 +63,10 @@ discard block |
||
63 | 63 | 'experimental_vs_ongoing' => ['nullable', $sliderRule], |
64 | 64 | 'citizen_facing_vs_back_office' => ['nullable', $sliderRule], |
65 | 65 | 'collaborative_vs_independent' => ['nullable', $sliderRule], |
66 | - 'telework_allowed_frequency_id' => ['nullable', new ValidIdRule(Frequency::class)], |
|
67 | - 'flexible_hours_frequency_id' => ['nullable', new ValidIdRule(Frequency::class)], |
|
68 | - 'travel_requirement_id' => ['nullable', new ValidIdRule(TravelRequirement::class)], |
|
69 | - 'overtime_requirement_id' => ['nullable', new ValidIdRule(OvertimeRequirement::class)], |
|
66 | + 'telework_allowed_frequency_id' => ['nullable', new ValidIdRule (Frequency::class)], |
|
67 | + 'flexible_hours_frequency_id' => ['nullable', new ValidIdRule (Frequency::class)], |
|
68 | + 'travel_requirement_id' => ['nullable', new ValidIdRule (TravelRequirement::class)], |
|
69 | + 'overtime_requirement_id' => ['nullable', new ValidIdRule (OvertimeRequirement::class)], |
|
70 | 70 | 'en.city' => 'nullable|string', |
71 | 71 | 'en.title' => 'nullable|string', |
72 | 72 | 'en.dept_impact' => 'nullable|string', |