@@ -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), |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | ->name('api.jobs.submit'); |
495 | 495 | Route::resource('jobs', 'Api\JobApiController')->only([ |
496 | 496 | 'show', 'store', 'update' |
497 | - ])->names([ // Specify custom names because default names collied with existing routes. |
|
497 | + ])->names([// Specify custom names because default names collied with existing routes. |
|
498 | 498 | 'show' => 'api.jobs.show', |
499 | 499 | 'store' => 'api.jobs.store', |
500 | 500 | 'update' => 'api.jobs.update' |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | |
503 | 503 | Route::resource('managers', 'Api\ManagerApiController')->only([ |
504 | 504 | 'show', 'update' |
505 | - ])->names([ // Specify custom names because default names collied with existing routes |
|
505 | + ])->names([// Specify custom names because default names collied with existing routes |
|
506 | 506 | 'show' => 'api.managers.show', |
507 | 507 | 'update' => 'api.managers.update' |
508 | 508 | ]); |
@@ -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'; |