@@ -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 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * @property \Illuminate\Database\Eloquent\Collection $skill_declarations |
47 | 47 | * @property \App\Models\ApplicationReview $application_review |
48 | 48 | */ |
49 | -class JobApplication extends BaseModel { |
|
49 | +class JobApplication extends BaseModel{ |
|
50 | 50 | |
51 | 51 | use Notifiable; |
52 | 52 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | //TODO: determine whether sections are complete or invalid |
151 | 151 | $validator = new ApplicationValidator(); |
152 | 152 | $status = 'incomplete'; |
153 | - switch($section) { |
|
153 | + switch ($section) { |
|
154 | 154 | case 'basics': |
155 | 155 | if ($validator->basicsComplete($this)) { |
156 | 156 | $status = 'complete'; |