@@ -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; |
@@ -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); |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | * |
| 20 | 20 | * @property \App\Models\WorkplacePhotoCaption $workplace_photo_caption |
| 21 | 21 | */ |
| 22 | -class WorkplacePhoto extends BaseModel { |
|
| 22 | +class WorkplacePhoto extends BaseModel{ |
|
| 23 | 23 | |
| 24 | 24 | protected $casts = [ |
| 25 | 25 | 'image' => 'boolean', |
@@ -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'; |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | public function meetsEssentialCriteria(): bool |
| 202 | 202 | { |
| 203 | 203 | $essentialCriteria = $this->job_poster->criteria->filter( |
| 204 | - function ($value, $key) { |
|
| 204 | + function($value, $key) { |
|
| 205 | 205 | return $value->criteria_type->name == 'essential'; |
| 206 | 206 | } |
| 207 | 207 | ); |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | * |
| 21 | 21 | * @property \App\Models\WorkEnvironment $work_environment |
| 22 | 22 | */ |
| 23 | -class WorkEnvironmentTranslation extends BaseModel { |
|
| 23 | +class WorkEnvironmentTranslation extends BaseModel{ |
|
| 24 | 24 | |
| 25 | 25 | protected $fillable = [ |
| 26 | 26 | 'things_to_know' |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | * |
| 21 | 21 | * @property \App\Models\JobPosterQuestion $job_poster_question |
| 22 | 22 | */ |
| 23 | -class JobPosterQuestionTranslation extends BaseModel { |
|
| 23 | +class JobPosterQuestionTranslation extends BaseModel{ |
|
| 24 | 24 | |
| 25 | 25 | protected $casts = [ |
| 26 | 26 | 'job_poster_question_id' => 'int' |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | * @property \App\Models\Applicant $applicant |
| 21 | 21 | * @property \App\Models\Lookup\ApplicantProfileQuestion $applicant_profile_question |
| 22 | 22 | */ |
| 23 | -class ApplicantProfileAnswer extends BaseModel { |
|
| 23 | +class ApplicantProfileAnswer extends BaseModel{ |
|
| 24 | 24 | |
| 25 | 25 | protected $casts = [ |
| 26 | 26 | 'applicant_id' => 'int', |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | * @property \App\Models\WorkEnvironment $work_environment |
| 22 | 22 | * @property \App\Models\WorkplacePhoto $workplace_photo |
| 23 | 23 | */ |
| 24 | -class WorkplacePhotoCaption extends BaseModel { |
|
| 24 | +class WorkplacePhotoCaption extends BaseModel{ |
|
| 25 | 25 | |
| 26 | 26 | protected $casts = [ |
| 27 | 27 | 'work_environment_id' => 'int', |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | * @property \App\Models\JobApplication $job_application |
| 21 | 21 | * @property \App\Models\JobPosterQuestion $job_poster_question |
| 22 | 22 | */ |
| 23 | -class JobApplicationAnswer extends BaseModel { |
|
| 23 | +class JobApplicationAnswer extends BaseModel{ |
|
| 24 | 24 | |
| 25 | 25 | protected $casts = [ |
| 26 | 26 | 'job_poster_questions_id' => 'int', |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | * |
| 20 | 20 | * @property \App\Models\JobPosterKeyTask $job_poster_key_task |
| 21 | 21 | */ |
| 22 | -class JobPosterKeyTaskTranslation extends BaseModel { |
|
| 22 | +class JobPosterKeyTaskTranslation extends BaseModel{ |
|
| 23 | 23 | |
| 24 | 24 | protected $casts = [ |
| 25 | 25 | 'job_poster_key_task_id' => 'int' |