@@ -15,7 +15,7 @@ |
||
15 | 15 | * @property \Illuminate\Database\Eloquent\Collection $job_applications |
16 | 16 | * |
17 | 17 | */ |
18 | -class PreferredLanguage extends BaseModel { |
|
18 | +class PreferredLanguage extends BaseModel{ |
|
19 | 19 | |
20 | 20 | protected $fillable = []; |
21 | 21 |
@@ -21,7 +21,7 @@ |
||
21 | 21 | * |
22 | 22 | * @property \App\Models\Lookup\Relationship $relationship |
23 | 23 | */ |
24 | -class RelationshipTranslation extends BaseModel { |
|
24 | +class RelationshipTranslation extends BaseModel{ |
|
25 | 25 | |
26 | 26 | protected $casts = [ |
27 | 27 | 'relationship_id' => 'int' |
@@ -21,7 +21,7 @@ |
||
21 | 21 | * |
22 | 22 | * @property \App\Models\Lookup\SkillLevel $skill_level |
23 | 23 | */ |
24 | -class SkillLevelTranslation extends BaseModel { |
|
24 | +class SkillLevelTranslation extends BaseModel{ |
|
25 | 25 | |
26 | 26 | protected $casts = [ |
27 | 27 | 'skill_level_id' => 'int' |
@@ -21,7 +21,7 @@ |
||
21 | 21 | * |
22 | 22 | * @property \App\Models\Lookup\AssessmentType $assessment_type |
23 | 23 | */ |
24 | -class AssessmentTypeTranslation extends BaseModel { |
|
24 | +class AssessmentTypeTranslation extends BaseModel{ |
|
25 | 25 | |
26 | 26 | protected $casts = [ |
27 | 27 | 'id' => 'int', |
@@ -50,8 +50,7 @@ |
||
50 | 50 | |
51 | 51 | // Display slightly different views on different portals. |
52 | 52 | $view = WhichPortal::isManagerPortal() ? |
53 | - 'manager/application_post' : |
|
54 | - 'applicant/application_preview'; |
|
53 | + 'manager/application_post' : 'applicant/application_preview'; |
|
55 | 54 | |
56 | 55 | if (WhichPortal::isManagerPortal()) { |
57 | 56 | // Load things required for review component. |
@@ -43,7 +43,7 @@ |
||
43 | 43 | */ |
44 | 44 | public function view(User $user, Applicant $applicant) |
45 | 45 | { |
46 | - $authApplicant = $user->isApplicant() && |
|
46 | + $authApplicant = $user->isApplicant() && |
|
47 | 47 | $applicant->user->is($user); |
48 | 48 | $authManager = $user->isManager() && $this->ownsJobApplicantAppliedTo($user, $applicant); |
49 | 49 | return $authApplicant || $authManager; |
@@ -30,7 +30,7 @@ |
||
30 | 30 | 'first_name' => $faker->firstName(), |
31 | 31 | 'last_name' => $faker->lastName(), |
32 | 32 | 'email' => $faker->unique()->safeEmail(), |
33 | - 'password' => $password ? : $password = Hash::make('password'), |
|
33 | + 'password' => $password ?: $password = Hash::make('password'), |
|
34 | 34 | 'is_confirmed' => 1, |
35 | 35 | 'user_role_id' => UserRole::where('name', 'basic')->first()->id, // Users should default to basic user role. |
36 | 36 | 'remember_token' => str_random(10), |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | use App\Services\Validation\Rules\ContainsObjectWithAttributeRule; |
14 | 14 | use App\Services\Validation\JobApplicationAnswerValidator; |
15 | 15 | |
16 | -class ApplicationValidator { |
|
16 | +class ApplicationValidator{ |
|
17 | 17 | |
18 | 18 | protected $citizenship_ids; |
19 | 19 | protected $veteran_status_ids; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | protected function addNestedValidatorRules($nestedAttribute, $validatorRules, $rules = []) { |
79 | 79 | // prepend the attribute name of each validator rule with the nested attribute name |
80 | - $newRules = $this->arrayMapKeys(function($key) use ($nestedAttribute) { |
|
80 | + $newRules = $this->arrayMapKeys(function ($key) use ($nestedAttribute) { |
|
81 | 81 | return implode('.', [$nestedAttribute, $key]); |
82 | 82 | }, |
83 | 83 | $validatorRules); |
@@ -100,14 +100,14 @@ discard block |
||
100 | 100 | |
101 | 101 | // Validate that each question has been answered |
102 | 102 | $jobPosterQuestionRules = []; |
103 | - foreach($application->job_poster->job_poster_questions as $question) { |
|
103 | + foreach ($application->job_poster->job_poster_questions as $question) { |
|
104 | 104 | $jobPosterQuestionRules[] = new ContainsObjectWithAttributeRule('job_poster_question_id', $question->id); |
105 | 105 | } |
106 | 106 | $rules['job_application_answers'] = $jobPosterQuestionRules; |
107 | 107 | $answerValidatorFactory = new JobApplicationAnswerValidator($application); |
108 | 108 | |
109 | 109 | //Validate that each answer is complete |
110 | - foreach($application->job_application_answers as $key=>$answer) { |
|
110 | + foreach ($application->job_application_answers as $key=>$answer) { |
|
111 | 111 | $attribute = implode('.', ['job_application_answers', $key]); |
112 | 112 | $rules = $this->addNestedValidatorRules($attribute, $answerValidatorFactory->rules(), $rules); |
113 | 113 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | |
136 | 136 | $skillDeclarationRules = []; |
137 | 137 | $criteriaTypeId = CriteriaType::where('name', $criteria_type)->firstOrFail()->id; |
138 | - foreach($application->job_poster->criteria->where('criteria_type_id', $criteriaTypeId) as $criteria) { |
|
138 | + foreach ($application->job_poster->criteria->where('criteria_type_id', $criteriaTypeId) as $criteria) { |
|
139 | 139 | //Validate that every essential skill has a corresponding declaration |
140 | 140 | $skillDeclarationRules[] = new ContainsObjectWithAttributeRule('skill_id', $criteria->skill_id); |
141 | 141 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | //Validate that those declarations are complete |
146 | 146 | $skilDeclarationValidatorFactory = new SkillDeclarationValidator($application->applicant); |
147 | 147 | $relevantSkillIds = $application->job_poster->criteria->where('criteria_type_id', $criteriaTypeId)->pluck('skill_id'); |
148 | - foreach( $application->skill_declarations as $key=>$declaration) { |
|
148 | + foreach ($application->skill_declarations as $key=>$declaration) { |
|
149 | 149 | if ($relevantSkillIds->contains($declaration->skill_id)) { |
150 | 150 | $attribute = implode('.', ['skill_declarations', $key]); |
151 | 151 | $skillDeclarationValidator = $skilDeclarationValidatorFactory->validator($declaration); |
@@ -40,7 +40,7 @@ |
||
40 | 40 | */ |
41 | 41 | protected function commands(): void |
42 | 42 | { |
43 | - $this->load(__DIR__.'/Commands'); |
|
43 | + $this->load(__DIR__ . '/Commands'); |
|
44 | 44 | |
45 | 45 | require base_path('routes/console.php'); |
46 | 46 | } |