@@ -18,7 +18,7 @@ |
||
18 | 18 | { |
19 | 19 | protected $fillable = []; |
20 | 20 | |
21 | - public function degrees() { |
|
22 | - return $this->hasMany(\App\Models\Degree::class); |
|
21 | + public function degrees(){ |
|
22 | + return $this->hasMany (\App\Models\Degree::class); |
|
23 | 23 | } |
24 | 24 | } |
@@ -14,13 +14,13 @@ |
||
14 | 14 | * |
15 | 15 | * @property \Illuminate\Database\Eloquent\Collection $skills |
16 | 16 | */ |
17 | -class SkillType extends BaseModel { |
|
17 | +class SkillType extends BaseModel{ |
|
18 | 18 | |
19 | 19 | protected $fillable = [ |
20 | 20 | 'name' |
21 | 21 | ]; |
22 | 22 | |
23 | - public function skills() { |
|
24 | - return $this->hasMany(\App\Models\Skill::class); |
|
23 | + public function skills(){ |
|
24 | + return $this->hasMany (\App\Models\Skill::class); |
|
25 | 25 | } |
26 | 26 | } |
@@ -24,22 +24,22 @@ |
||
24 | 24 | * @property string $question |
25 | 25 | * @property string $description |
26 | 26 | */ |
27 | -class ApplicantProfileQuestion extends BaseModel { |
|
27 | +class ApplicantProfileQuestion extends BaseModel{ |
|
28 | 28 | |
29 | 29 | protected $fillable = []; |
30 | 30 | |
31 | - public function applicant_profile_answers() { |
|
32 | - return $this->hasMany(\App\Models\ApplicantProfileAnswer::class); |
|
31 | + public function applicant_profile_answers(){ |
|
32 | + return $this->hasMany (\App\Models\ApplicantProfileAnswer::class); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | // Accessors |
36 | 36 | |
37 | - public function getQuestionAttribute() { |
|
38 | - return Lang::get('common/lookup/applicant_profile_questions')[$this->name]['question']; |
|
37 | + public function getQuestionAttribute(){ |
|
38 | + return Lang::get ('common/lookup/applicant_profile_questions')[$this->name]['question']; |
|
39 | 39 | } |
40 | 40 | |
41 | - public function getDescriptionAttribute() { |
|
42 | - return Lang::get('common/lookup/applicant_profile_questions')[$this->name]['description']; |
|
41 | + public function getDescriptionAttribute(){ |
|
42 | + return Lang::get ('common/lookup/applicant_profile_questions')[$this->name]['description']; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * |
21 | 21 | * @property \App\Models\User $user |
22 | 22 | */ |
23 | -class ProfilePic extends BaseModel { |
|
23 | +class ProfilePic extends BaseModel{ |
|
24 | 24 | |
25 | 25 | protected $casts = [ |
26 | 26 | 'user_id' => 'int', |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | 'image' |
32 | 32 | ]; |
33 | 33 | |
34 | - public function user() { |
|
35 | - return $this->belongsTo(\App\Models\User::class); |
|
34 | + public function user(){ |
|
35 | + return $this->belongsTo (\App\Models\User::class); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | use Jenssegers\Date\Date; |
10 | 10 | use DateTime; |
11 | 11 | |
12 | -abstract class BaseModel extends Eloquent { |
|
12 | +abstract class BaseModel extends Eloquent{ |
|
13 | 13 | //Override date functions to return Jenssegers Data instead of Carbon |
14 | 14 | |
15 | 15 | /** |
@@ -30,13 +30,13 @@ discard block |
||
30 | 30 | */ |
31 | 31 | protected function asDateTime($value) |
32 | 32 | { |
33 | - $timezone = Config::get('app.timezone'); |
|
33 | + $timezone = Config::get ('app.timezone'); |
|
34 | 34 | |
35 | 35 | // If this value is already a Carbon instance, we shall just return it as is. |
36 | 36 | // This prevents us having to re-instantiate a Carbon instance when we know |
37 | 37 | // it already is one, which wouldn't be fulfilled by the DateTime check. |
38 | 38 | if ($value instanceof Carbon) { |
39 | - return Date::parse($value, $timezone); |
|
39 | + return Date::parse ($value, $timezone); |
|
40 | 40 | } |
41 | 41 | if ($value instanceof Date) { |
42 | 42 | return $value; |
@@ -45,35 +45,35 @@ discard block |
||
45 | 45 | // these checks since they will be a waste of time, and hinder performance |
46 | 46 | // when checking the field. We will just return the DateTime right away. |
47 | 47 | if ($value instanceof DateTimeInterface) { |
48 | - return new Date( |
|
48 | + return new Date ( |
|
49 | 49 | //$value->format('Y-m-d H:i:s.u'), $value->getTimeZone() |
50 | - $value->format('Y-m-d H:i:s.u'), $timezone |
|
50 | + $value->format ('Y-m-d H:i:s.u'), $timezone |
|
51 | 51 | ); |
52 | 52 | } |
53 | 53 | // If this value is an integer, we will assume it is a UNIX timestamp's value |
54 | 54 | // and format a Carbon object from this timestamp. This allows flexibility |
55 | 55 | // when defining your date fields as they might be UNIX timestamps here. |
56 | - if (is_numeric($value)) { |
|
57 | - return Date::createFromTimestamp($value, $timezone); |
|
56 | + if (is_numeric ($value)) { |
|
57 | + return Date::createFromTimestamp ($value, $timezone); |
|
58 | 58 | } |
59 | 59 | // If the value is in simply year, month, day format, we will instantiate the |
60 | 60 | // Carbon instances from that format. Again, this provides for simple date |
61 | 61 | // fields on the database, while still supporting Carbonized conversion. |
62 | - if (preg_match('/^(\d{4})-(\d{1,2})-(\d{1,2})$/', $value)) { |
|
63 | - return Date::createFromFormat('Y-m-d', $value, $timezone)->startOfDay(); |
|
62 | + if (preg_match ('/^(\d{4})-(\d{1,2})-(\d{1,2})$/', $value)) { |
|
63 | + return Date::createFromFormat ('Y-m-d', $value, $timezone)->startOfDay (); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | // If the date follows the api configured date format, use that. |
67 | - $apiFormat = Config::get('app.api_datetime_format'); |
|
68 | - $date = DateTime::createFromFormat($apiFormat, $value); |
|
69 | - if ($date && $date->format($apiFormat) == $value) { |
|
67 | + $apiFormat = Config::get ('app.api_datetime_format'); |
|
68 | + $date = DateTime::createFromFormat ($apiFormat, $value); |
|
69 | + if ($date && $date->format ($apiFormat) == $value) { |
|
70 | 70 | return $date; |
71 | 71 | } |
72 | 72 | |
73 | 73 | // Finally, we will just assume this date is in the format used by default on |
74 | 74 | // the database connection and use that format to create the Carbon object |
75 | 75 | // that is returned back out to the developers after we convert it here. |
76 | - return Date::createFromFormat($this->getDateFormat(), $value, $timezone); |
|
76 | + return Date::createFromFormat ($this->getDateFormat (), $value, $timezone); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
@@ -84,6 +84,6 @@ discard block |
||
84 | 84 | */ |
85 | 85 | protected function serializeDate(DateTimeInterface $date) |
86 | 86 | { |
87 | - return $date->format(Config::get('app.api_datetime_format')); |
|
87 | + return $date->format (Config::get ('app.api_datetime_format')); |
|
88 | 88 | } |
89 | 89 | } |
@@ -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 | |
@@ -85,52 +85,52 @@ discard block |
||
85 | 85 | */ |
86 | 86 | protected $appends = ['meets_essential_criteria']; |
87 | 87 | |
88 | - protected function createApplicantSnapshot($applicant_id) { |
|
89 | - $applicant = Applicant::where('id', $applicant_id)->firstOrFail(); |
|
88 | + protected function createApplicantSnapshot($applicant_id){ |
|
89 | + $applicant = Applicant::where ('id', $applicant_id)->firstOrFail (); |
|
90 | 90 | |
91 | - $snapshot = $applicant->replicate(); |
|
91 | + $snapshot = $applicant->replicate (); |
|
92 | 92 | |
93 | 93 | } |
94 | 94 | |
95 | - public function applicant() { |
|
96 | - return $this->belongsTo(\App\Models\Applicant::class); |
|
95 | + public function applicant(){ |
|
96 | + return $this->belongsTo (\App\Models\Applicant::class); |
|
97 | 97 | } |
98 | 98 | |
99 | - public function applicant_snapshot() { |
|
100 | - return $this->belongsTo(\App\Models\Applicant::class, 'applicant_snapshot_id'); |
|
99 | + public function applicant_snapshot(){ |
|
100 | + return $this->belongsTo (\App\Models\Applicant::class, 'applicant_snapshot_id'); |
|
101 | 101 | } |
102 | 102 | |
103 | - public function application_status() { |
|
104 | - return $this->belongsTo(\App\Models\Lookup\ApplicationStatus::class); |
|
103 | + public function application_status(){ |
|
104 | + return $this->belongsTo (\App\Models\Lookup\ApplicationStatus::class); |
|
105 | 105 | } |
106 | 106 | |
107 | - public function citizenship_declaration() { |
|
108 | - return $this->belongsTo(\App\Models\Lookup\CitizenshipDeclaration::class); |
|
107 | + public function citizenship_declaration(){ |
|
108 | + return $this->belongsTo (\App\Models\Lookup\CitizenshipDeclaration::class); |
|
109 | 109 | } |
110 | 110 | |
111 | - public function veteran_status() { |
|
112 | - return $this->belongsTo(\App\Models\Lookup\VeteranStatus::class); |
|
111 | + public function veteran_status(){ |
|
112 | + return $this->belongsTo (\App\Models\Lookup\VeteranStatus::class); |
|
113 | 113 | } |
114 | 114 | |
115 | - public function preferred_language() { |
|
116 | - return $this->belongsTo(\App\Models\Lookup\PreferredLanguage::class); |
|
115 | + public function preferred_language(){ |
|
116 | + return $this->belongsTo (\App\Models\Lookup\PreferredLanguage::class); |
|
117 | 117 | } |
118 | 118 | |
119 | - public function job_poster() { |
|
120 | - return $this->belongsTo(\App\Models\JobPoster::class); |
|
119 | + public function job_poster(){ |
|
120 | + return $this->belongsTo (\App\Models\JobPoster::class); |
|
121 | 121 | } |
122 | 122 | |
123 | - public function job_application_answers() { |
|
124 | - return $this->hasMany(\App\Models\JobApplicationAnswer::class); |
|
123 | + public function job_application_answers(){ |
|
124 | + return $this->hasMany (\App\Models\JobApplicationAnswer::class); |
|
125 | 125 | } |
126 | 126 | |
127 | - public function skill_declarations() { |
|
128 | - return $this->applicant->skill_declarations() |
|
129 | - ->whereIn('skill_id', $this->job_poster->criteria->pluck('skill_id')); |
|
127 | + public function skill_declarations(){ |
|
128 | + return $this->applicant->skill_declarations () |
|
129 | + ->whereIn ('skill_id', $this->job_poster->criteria->pluck ('skill_id')); |
|
130 | 130 | } |
131 | 131 | |
132 | - public function application_review() { |
|
133 | - return $this->hasOne(ApplicationReview::class); |
|
132 | + public function application_review(){ |
|
133 | + return $this->hasOne (ApplicationReview::class); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | /** |
@@ -146,41 +146,41 @@ discard block |
||
146 | 146 | * |
147 | 147 | * @return string $status 'complete', 'incomplete' or 'error' |
148 | 148 | */ |
149 | - public function getSectionStatus(string $section) { |
|
149 | + public function getSectionStatus(string $section){ |
|
150 | 150 | //TODO: determine whether sections are complete or invalid |
151 | - $validator = new ApplicationValidator(); |
|
151 | + $validator = new ApplicationValidator (); |
|
152 | 152 | $status = 'incomplete'; |
153 | - switch($section) { |
|
153 | + switch ($section) { |
|
154 | 154 | case 'basics': |
155 | - if ($validator->basicsComplete($this)) { |
|
155 | + if ($validator->basicsComplete ($this)) { |
|
156 | 156 | $status = 'complete'; |
157 | 157 | } |
158 | 158 | break; |
159 | 159 | case 'experience': |
160 | - if ($validator->experienceComplete($this)) { |
|
160 | + if ($validator->experienceComplete ($this)) { |
|
161 | 161 | $status = 'complete'; |
162 | 162 | } |
163 | 163 | break; |
164 | 164 | case 'essential_skills': |
165 | - if ($validator->essentialSkillsComplete($this)) { |
|
165 | + if ($validator->essentialSkillsComplete ($this)) { |
|
166 | 166 | $status = 'complete'; |
167 | 167 | } |
168 | 168 | break; |
169 | 169 | case 'asset_skills': |
170 | - if ($validator->assetSkillsComplete($this)) { |
|
170 | + if ($validator->assetSkillsComplete ($this)) { |
|
171 | 171 | $status = 'complete'; |
172 | 172 | } |
173 | 173 | break; |
174 | 174 | case 'preview': |
175 | - if ($validator->basicsComplete($this) && |
|
176 | - $validator->experienceComplete($this) && |
|
177 | - $validator->essentialSkillsComplete($this) && |
|
178 | - $validator->assetSkillsComplete($this)) { |
|
175 | + if ($validator->basicsComplete ($this) && |
|
176 | + $validator->experienceComplete ($this) && |
|
177 | + $validator->essentialSkillsComplete ($this) && |
|
178 | + $validator->assetSkillsComplete ($this)) { |
|
179 | 179 | $status = 'complete'; |
180 | 180 | } |
181 | 181 | break; |
182 | 182 | case 'confirm': |
183 | - if ($validator->affirmationComplete($this)) { |
|
183 | + if ($validator->affirmationComplete ($this)) { |
|
184 | 184 | $status = 'complete'; |
185 | 185 | } |
186 | 186 | break; |
@@ -200,13 +200,13 @@ discard block |
||
200 | 200 | */ |
201 | 201 | public function meetsEssentialCriteria(): bool |
202 | 202 | { |
203 | - $essentialCriteria = $this->job_poster->criteria->filter( |
|
204 | - function ($value, $key) { |
|
203 | + $essentialCriteria = $this->job_poster->criteria->filter ( |
|
204 | + function ($value, $key){ |
|
205 | 205 | return $value->criteria_type->name == 'essential'; |
206 | 206 | } |
207 | 207 | ); |
208 | 208 | foreach ($essentialCriteria as $criterion) { |
209 | - $skillDeclaration = $this->skill_declarations->where("skill_id", $criterion->skill_id)->first(); |
|
209 | + $skillDeclaration = $this->skill_declarations->where ("skill_id", $criterion->skill_id)->first (); |
|
210 | 210 | if ($skillDeclaration === null || |
211 | 211 | $skillDeclaration->skill_level_id < $criterion->skill_level_id) { |
212 | 212 | return false; |
@@ -223,6 +223,6 @@ discard block |
||
223 | 223 | */ |
224 | 224 | public function getMeetsEssentialCriteriaAttribute():bool |
225 | 225 | { |
226 | - return $this->meetsEssentialCriteria(); |
|
226 | + return $this->meetsEssentialCriteria (); |
|
227 | 227 | } |
228 | 228 | } |
@@ -20,7 +20,7 @@ discard block |
||
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', |
@@ -34,12 +34,12 @@ discard block |
||
34 | 34 | 'applicant_profile_question' |
35 | 35 | ]; |
36 | 36 | |
37 | - public function applicant() { |
|
38 | - return $this->belongsTo(\App\Models\Applicant::class); |
|
37 | + public function applicant(){ |
|
38 | + return $this->belongsTo (\App\Models\Applicant::class); |
|
39 | 39 | } |
40 | 40 | |
41 | - public function applicant_profile_question() { |
|
42 | - return $this->belongsTo(\App\Models\Lookup\ApplicantProfileQuestion::class); |
|
41 | + public function applicant_profile_question(){ |
|
42 | + return $this->belongsTo (\App\Models\Lookup\ApplicantProfileQuestion::class); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | } |
@@ -20,7 +20,7 @@ discard block |
||
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', |
@@ -30,12 +30,12 @@ discard block |
||
30 | 30 | 'answer' |
31 | 31 | ]; |
32 | 32 | |
33 | - public function job_application() { |
|
34 | - return $this->belongsTo(\App\Models\JobApplication::class); |
|
33 | + public function job_application(){ |
|
34 | + return $this->belongsTo (\App\Models\JobApplication::class); |
|
35 | 35 | } |
36 | 36 | |
37 | - public function job_poster_question() { |
|
38 | - return $this->belongsTo(\App\Models\JobPosterQuestion::class); |
|
37 | + public function job_poster_question(){ |
|
38 | + return $this->belongsTo (\App\Models\JobPosterQuestion::class); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | } |
@@ -21,7 +21,7 @@ discard block |
||
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', |
@@ -32,12 +32,12 @@ discard block |
||
32 | 32 | 'description' |
33 | 33 | ]; |
34 | 34 | |
35 | - public function work_environment() { |
|
36 | - return $this->belongsTo(\App\Models\WorkEnvironment::class); |
|
35 | + public function work_environment(){ |
|
36 | + return $this->belongsTo (\App\Models\WorkEnvironment::class); |
|
37 | 37 | } |
38 | 38 | |
39 | - public function workplace_photo() { |
|
40 | - return $this->belongsTo(\App\Models\WorkplacePhoto::class); |
|
39 | + public function workplace_photo(){ |
|
40 | + return $this->belongsTo (\App\Models\WorkplacePhoto::class); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | } |