@@ -21,10 +21,10 @@ discard block |
||
21 | 21 | { |
22 | 22 | // Anyone can view a published job |
23 | 23 | // Only the manager that created it can view an unpublished job |
24 | - return $jobPoster->status() == 'published' || $jobPoster->status() == 'closed' || |
|
24 | + return $jobPoster->status () == 'published' || $jobPoster->status () == 'closed' || |
|
25 | 25 | ( |
26 | 26 | $user && |
27 | - $user->isManager() && |
|
27 | + $user->isManager () && |
|
28 | 28 | $jobPoster->manager->user_id == $user->id |
29 | 29 | ); |
30 | 30 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | public function create(User $user) |
39 | 39 | { |
40 | 40 | // Any manager can create a new job poster. |
41 | - return $user->isManager(); |
|
41 | + return $user->isManager (); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | public function update(User $user, JobPoster $jobPoster) |
52 | 52 | { |
53 | 53 | // Only managers can edit jobs, and only their own, managers can't publish jobs or edit published jobs |
54 | - return $user->isManager() && |
|
54 | + return $user->isManager () && |
|
55 | 55 | $jobPoster->manager->user->id == $user->id && |
56 | 56 | !$jobPoster->published; |
57 | 57 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | { |
69 | 69 | // Jobs can only be deleted when they're in the 'draft' |
70 | 70 | // state, and only by managers that created them. |
71 | - return $user->isManager() && |
|
71 | + return $user->isManager () && |
|
72 | 72 | $jobPoster->manager->user->id == $user->id && |
73 | 73 | !$jobPoster->published; |
74 | 74 | } |
@@ -84,9 +84,9 @@ discard block |
||
84 | 84 | { |
85 | 85 | // Only upgradedManagers can submit jobs for review, only their own jobs, and only if they're still drafts. |
86 | 86 | // NOTE: this is one of the only permissions to require an upgradedManager, as opposed to a demoManager. |
87 | - return $user->isUpgradedManager() && |
|
87 | + return $user->isUpgradedManager () && |
|
88 | 88 | $jobPoster->manager->user->id == $user->id && |
89 | - $jobPoster->status() === 'draft'; |
|
89 | + $jobPoster->status () === 'draft'; |
|
90 | 90 | } |
91 | 91 | /** |
92 | 92 | * Determine whether the user can review applications to the job poster. |
@@ -98,9 +98,9 @@ discard block |
||
98 | 98 | public function reviewApplicationsFor(User $user, JobPoster $jobPoster) |
99 | 99 | { |
100 | 100 | // Only managers can review applications, and only for their own jobs. |
101 | - return $user->isManager() && |
|
101 | + return $user->isManager () && |
|
102 | 102 | $jobPoster->manager->user->id == $user->id && |
103 | - $jobPoster->isClosed(); |
|
103 | + $jobPoster->isClosed (); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function claim(User $user, JobPoster $jobPoster) : bool |
114 | 114 | { |
115 | - return $user->isHrAdvisor(); |
|
115 | + return $user->isHrAdvisor (); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
@@ -124,6 +124,6 @@ discard block |
||
124 | 124 | */ |
125 | 125 | public function unClaim(User $user, JobPoster $jobPoster) : bool |
126 | 126 | { |
127 | - return $this->claim($user, $jobPoster); |
|
127 | + return $this->claim ($user, $jobPoster); |
|
128 | 128 | } |
129 | 129 | } |
@@ -16,11 +16,11 @@ |
||
16 | 16 | */ |
17 | 17 | public function view(User $user, HrAdvisor $hrAdvisor) |
18 | 18 | { |
19 | - return $user->isHrAdvisor() && $hrAdvisor->user_id === $user->id; |
|
19 | + return $user->isHrAdvisor () && $hrAdvisor->user_id === $user->id; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | public function update(User $user, HrAdvisor $hrAdvisor) |
23 | 23 | { |
24 | - return $user->isHrAdvisor() && $hrAdvisor->user_id === $user->id; |
|
24 | + return $user->isHrAdvisor () && $hrAdvisor->user_id === $user->id; |
|
25 | 25 | } |
26 | 26 | } |
@@ -20,7 +20,7 @@ discard block |
||
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' |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | 'description' |
31 | 31 | ]; |
32 | 32 | |
33 | - public function job_poster_question() { |
|
34 | - return $this->belongsTo(\App\Models\JobPosterQuestion::class); |
|
33 | + public function job_poster_question(){ |
|
34 | + return $this->belongsTo (\App\Models\JobPosterQuestion::class); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | } |
@@ -47,11 +47,11 @@ |
||
47 | 47 | |
48 | 48 | public function manager() |
49 | 49 | { |
50 | - return $this->belongsTo(\App\Models\Manager::class); |
|
50 | + return $this->belongsTo (\App\Models\Manager::class); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | public function team_culture_translations() //phpcs:ignore |
54 | 54 | { |
55 | - return $this->hasMany(\App\Models\TeamCultureTranslation::class); |
|
55 | + return $this->hasMany (\App\Models\TeamCultureTranslation::class); |
|
56 | 56 | } |
57 | 57 | } |
@@ -65,27 +65,27 @@ discard block |
||
65 | 65 | |
66 | 66 | public function criteria_type() //phpcs:ignore |
67 | 67 | { |
68 | - return $this->belongsTo(\App\Models\Lookup\CriteriaType::class); |
|
68 | + return $this->belongsTo (\App\Models\Lookup\CriteriaType::class); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | public function job_poster() //phpcs:ignore |
72 | 72 | { |
73 | - return $this->belongsTo(\App\Models\JobPoster::class); |
|
73 | + return $this->belongsTo (\App\Models\JobPoster::class); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | public function skill() |
77 | 77 | { |
78 | - return $this->belongsTo(\App\Models\Skill::class); |
|
78 | + return $this->belongsTo (\App\Models\Skill::class); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | public function skill_level() //phpcs:ignore |
82 | 82 | { |
83 | - return $this->belongsTo(\App\Models\Lookup\SkillLevel::class); |
|
83 | + return $this->belongsTo (\App\Models\Lookup\SkillLevel::class); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | public function criteria_translations() //phpcs:ignore |
87 | 87 | { |
88 | - return $this->hasMany(\App\Models\Lookup\CriteriaTypeTranslation::class); |
|
88 | + return $this->hasMany (\App\Models\Lookup\CriteriaTypeTranslation::class); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function assessments() // phpcs:ignore |
97 | 97 | { |
98 | - return $this->hasMany(\App\Models\Assessment::class, 'criterion_id'); |
|
98 | + return $this->hasMany (\App\Models\Assessment::class, 'criterion_id'); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | { |
108 | 108 | $level = $this->skill_level->name; |
109 | 109 | $type = $this->skill->skill_type->name; |
110 | - return Lang::get("common/lookup/skill_level.$level.$type.name"); |
|
110 | + return Lang::get ("common/lookup/skill_level.$level.$type.name"); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
@@ -119,6 +119,6 @@ discard block |
||
119 | 119 | { |
120 | 120 | $level = $this->skill_level->name; |
121 | 121 | $type = $this->skill->skill_type->name; |
122 | - return Lang::get("common/lookup/skill_level.$level.$type.description"); |
|
122 | + return Lang::get ("common/lookup/skill_level.$level.$type.description"); |
|
123 | 123 | } |
124 | 124 | } |
@@ -52,17 +52,17 @@ discard block |
||
52 | 52 | |
53 | 53 | public function user() |
54 | 54 | { |
55 | - return $this->belongsTo(\App\Models\User::class); |
|
55 | + return $this->belongsTo (\App\Models\User::class); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | public function department() |
59 | 59 | { |
60 | - return $this->belongsTo(\App\Models\Lookup\Department::class); |
|
60 | + return $this->belongsTo (\App\Models\Lookup\Department::class); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | public function claimed_jobs() |
64 | 64 | { |
65 | - return $this->belongsToMany( |
|
65 | + return $this->belongsToMany ( |
|
66 | 66 | \App\Models\JobPoster::class, |
67 | 67 | 'claimed_jobs' |
68 | 68 | ); |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | public function getNameAttribute(): string |
77 | 77 | { |
78 | 78 | if ($this->user !== null) { |
79 | - return $this->user->first_name . ' ' . $this->user->last_name; |
|
79 | + return $this->user->first_name.' '.$this->user->last_name; |
|
80 | 80 | } |
81 | 81 | return ''; |
82 | 82 | } |
@@ -88,6 +88,6 @@ discard block |
||
88 | 88 | */ |
89 | 89 | public function getClaimedJobIdsAttribute() |
90 | 90 | { |
91 | - return $this->claimed_jobs()->allRelatedIds()->toArray(); |
|
91 | + return $this->claimed_jobs ()->allRelatedIds ()->toArray (); |
|
92 | 92 | } |
93 | 93 | } |
@@ -20,13 +20,13 @@ |
||
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' |
27 | 27 | ]; |
28 | 28 | |
29 | - public function work_environment() { |
|
30 | - return $this->belongsTo(\App\Models\WorkEnvironment::class); |
|
29 | + public function work_environment(){ |
|
30 | + return $this->belongsTo (\App\Models\WorkEnvironment::class); |
|
31 | 31 | } |
32 | 32 | } |
@@ -273,42 +273,42 @@ discard block |
||
273 | 273 | // @codeCoverageIgnoreStart |
274 | 274 | public function department() // phpcs:ignore |
275 | 275 | { |
276 | - return $this->belongsTo(\App\Models\Lookup\Department::class); |
|
276 | + return $this->belongsTo (\App\Models\Lookup\Department::class); |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | public function job_term() // phpcs:ignore |
280 | 280 | { |
281 | - return $this->belongsTo(\App\Models\Lookup\JobTerm::class); |
|
281 | + return $this->belongsTo (\App\Models\Lookup\JobTerm::class); |
|
282 | 282 | } |
283 | 283 | |
284 | 284 | public function language_requirement() // phpcs:ignore |
285 | 285 | { |
286 | - return $this->belongsTo(\App\Models\Lookup\LanguageRequirement::class); |
|
286 | + return $this->belongsTo (\App\Models\Lookup\LanguageRequirement::class); |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | public function manager() // phpcs:ignore |
290 | 290 | { |
291 | - return $this->belongsTo(\App\Models\Manager::class); |
|
291 | + return $this->belongsTo (\App\Models\Manager::class); |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | public function province() // phpcs:ignore |
295 | 295 | { |
296 | - return $this->belongsTo(\App\Models\Lookup\Province::class); |
|
296 | + return $this->belongsTo (\App\Models\Lookup\Province::class); |
|
297 | 297 | } |
298 | 298 | |
299 | 299 | public function security_clearance() // phpcs:ignore |
300 | 300 | { |
301 | - return $this->belongsTo(\App\Models\Lookup\SecurityClearance::class); |
|
301 | + return $this->belongsTo (\App\Models\Lookup\SecurityClearance::class); |
|
302 | 302 | } |
303 | 303 | |
304 | 304 | public function criteria() // phpcs:ignore |
305 | 305 | { |
306 | - return $this->hasMany(\App\Models\Criteria::class); |
|
306 | + return $this->hasMany (\App\Models\Criteria::class); |
|
307 | 307 | } |
308 | 308 | |
309 | 309 | public function hr_advisors() // phpcs:ignore |
310 | 310 | { |
311 | - return $this->belongsToMany( |
|
311 | + return $this->belongsToMany ( |
|
312 | 312 | \App\Models\HrAdvisor::class, |
313 | 313 | 'claimed_jobs' |
314 | 314 | ); |
@@ -316,47 +316,47 @@ discard block |
||
316 | 316 | |
317 | 317 | public function job_applications() // phpcs:ignore |
318 | 318 | { |
319 | - return $this->hasMany(\App\Models\JobApplication::class); |
|
319 | + return $this->hasMany (\App\Models\JobApplication::class); |
|
320 | 320 | } |
321 | 321 | |
322 | 322 | public function job_poster_key_tasks() // phpcs:ignore |
323 | 323 | { |
324 | - return $this->hasMany(\App\Models\JobPosterKeyTask::class); |
|
324 | + return $this->hasMany (\App\Models\JobPosterKeyTask::class); |
|
325 | 325 | } |
326 | 326 | |
327 | 327 | public function job_poster_questions() // phpcs:ignore |
328 | 328 | { |
329 | - return $this->hasMany(\App\Models\JobPosterQuestion::class); |
|
329 | + return $this->hasMany (\App\Models\JobPosterQuestion::class); |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | public function job_poster_translations() // phpcs:ignore |
333 | 333 | { |
334 | - return $this->hasMany(\App\Models\JobPosterTranslation::class); |
|
334 | + return $this->hasMany (\App\Models\JobPosterTranslation::class); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | public function telework_allowed_frequency() // phpcs:ignore |
338 | 338 | { |
339 | - return $this->belongsTo(\App\Models\Lookup\Frequency::class); |
|
339 | + return $this->belongsTo (\App\Models\Lookup\Frequency::class); |
|
340 | 340 | } |
341 | 341 | |
342 | 342 | public function flexible_hours_frequency() // phpcs:ignore |
343 | 343 | { |
344 | - return $this->belongsTo(\App\Models\Lookup\Frequency::class); |
|
344 | + return $this->belongsTo (\App\Models\Lookup\Frequency::class); |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | public function travel_requirement() // phpcs:ignore |
348 | 348 | { |
349 | - return $this->belongsTo(\App\Models\Lookup\TravelRequirement::class); |
|
349 | + return $this->belongsTo (\App\Models\Lookup\TravelRequirement::class); |
|
350 | 350 | } |
351 | 351 | |
352 | 352 | public function overtime_requirement() // phpcs:ignore |
353 | 353 | { |
354 | - return $this->belongsTo(\App\Models\Lookup\OvertimeRequirement::class); |
|
354 | + return $this->belongsTo (\App\Models\Lookup\OvertimeRequirement::class); |
|
355 | 355 | } |
356 | 356 | |
357 | 357 | public function classification() // phpcs:ignore |
358 | 358 | { |
359 | - return $this->belongsTo(\App\Models\Classification::class); |
|
359 | + return $this->belongsTo (\App\Models\Classification::class); |
|
360 | 360 | } |
361 | 361 | // @codeCoverageIgnoreEnd |
362 | 362 | /* Artificial Relations */ |
@@ -369,8 +369,8 @@ discard block |
||
369 | 369 | */ |
370 | 370 | public function submitted_applications() // phpcs:ignore |
371 | 371 | { |
372 | - return $this->hasMany(\App\Models\JobApplication::class)->whereDoesntHave('application_status', function ($query): void { |
|
373 | - $query->where('name', 'draft'); |
|
372 | + return $this->hasMany (\App\Models\JobApplication::class)->whereDoesntHave ('application_status', function ($query): void { |
|
373 | + $query->where ('name', 'draft'); |
|
374 | 374 | }); |
375 | 375 | } |
376 | 376 | |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | */ |
390 | 390 | public function resolveRouteBinding($value) // phpcs:ignore |
391 | 391 | { |
392 | - return $this->withCount('submitted_applications')->where('id', $value)->first() ?? abort(404); |
|
392 | + return $this->withCount ('submitted_applications')->where ('id', $value)->first () ?? abort (404); |
|
393 | 393 | } |
394 | 394 | |
395 | 395 | /** |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | public function setPublishedAttribute($value): void |
404 | 404 | { |
405 | 405 | if ($value) { |
406 | - $this->attributes['published_at'] = new Date(); |
|
406 | + $this->attributes['published_at'] = new Date (); |
|
407 | 407 | } else { |
408 | 408 | $this->attributes['published_at'] = null; |
409 | 409 | } |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | |
418 | 418 | public function submitted_applications_count() //phpcs:ignore |
419 | 419 | { |
420 | - return $this->submitted_applications()->count(); |
|
420 | + return $this->submitted_applications ()->count (); |
|
421 | 421 | } |
422 | 422 | |
423 | 423 | /** |
@@ -427,15 +427,15 @@ discard block |
||
427 | 427 | */ |
428 | 428 | public function applyBy(): array |
429 | 429 | { |
430 | - $localCloseDate = new Date($this->close_date_time); // This initializes the date object in UTC time. |
|
431 | - $localCloseDate->setTimezone(new \DateTimeZone(self::TIMEZONE)); // Then set the time zone for display. |
|
430 | + $localCloseDate = new Date ($this->close_date_time); // This initializes the date object in UTC time. |
|
431 | + $localCloseDate->setTimezone (new \DateTimeZone (self::TIMEZONE)); // Then set the time zone for display. |
|
432 | 432 | $displayDate = [ |
433 | - 'date' => $localCloseDate->format(self::DATE_FORMAT[App::getLocale()]), |
|
434 | - 'time' => $localCloseDate->format(self::TIME_FORMAT[App::getLocale()]) |
|
433 | + 'date' => $localCloseDate->format (self::DATE_FORMAT[App::getLocale ()]), |
|
434 | + 'time' => $localCloseDate->format (self::TIME_FORMAT[App::getLocale ()]) |
|
435 | 435 | ]; |
436 | 436 | |
437 | - if (App::isLocale('fr')) { |
|
438 | - $displayDate['time'] = str_replace(['EST', 'EDT'], ['HNE', 'HAE'], $displayDate['time']); |
|
437 | + if (App::isLocale ('fr')) { |
|
438 | + $displayDate['time'] = str_replace (['EST', 'EDT'], ['HNE', 'HAE'], $displayDate['time']); |
|
439 | 439 | } |
440 | 440 | |
441 | 441 | return $displayDate; |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | */ |
450 | 450 | public function displayStatus(): string |
451 | 451 | { |
452 | - return $this->isOpen() ? 'Open' : 'Closed'; |
|
452 | + return $this->isOpen () ? 'Open' : 'Closed'; |
|
453 | 453 | } |
454 | 454 | |
455 | 455 | /** |
@@ -462,8 +462,8 @@ discard block |
||
462 | 462 | return $this->published |
463 | 463 | && $this->open_date_time !== null |
464 | 464 | && $this->close_date_time !== null |
465 | - && $this->open_date_time->isPast() |
|
466 | - && $this->close_date_time->isFuture(); |
|
465 | + && $this->open_date_time->isPast () |
|
466 | + && $this->close_date_time->isFuture (); |
|
467 | 467 | } |
468 | 468 | |
469 | 469 | /** |
@@ -476,8 +476,8 @@ discard block |
||
476 | 476 | return $this->published |
477 | 477 | && $this->open_date_time !== null |
478 | 478 | && $this->close_date_time !== null |
479 | - && $this->open_date_time->isPast() |
|
480 | - && $this->close_date_time->isPast(); |
|
479 | + && $this->open_date_time->isPast () |
|
480 | + && $this->close_date_time->isPast (); |
|
481 | 481 | } |
482 | 482 | |
483 | 483 | /** |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | */ |
488 | 488 | public function timeRemaining(): string |
489 | 489 | { |
490 | - $interval = $this->close_date_time->diff(Date::now()); |
|
490 | + $interval = $this->close_date_time->diff (Date::now ()); |
|
491 | 491 | |
492 | 492 | $d = $interval->d; |
493 | 493 | $h = $interval->h; |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | |
511 | 511 | $key = "common/time.$unit"; |
512 | 512 | |
513 | - return Lang::choice($key, $count); |
|
513 | + return Lang::choice ($key, $count); |
|
514 | 514 | } |
515 | 515 | |
516 | 516 | /** |
@@ -522,9 +522,9 @@ discard block |
||
522 | 522 | public function status(): string |
523 | 523 | { |
524 | 524 | $status = 'draft'; |
525 | - if ($this->isOpen()) { |
|
525 | + if ($this->isOpen ()) { |
|
526 | 526 | $status = 'published'; |
527 | - } elseif ($this->isClosed()) { |
|
527 | + } elseif ($this->isClosed ()) { |
|
528 | 528 | $status = 'closed'; |
529 | 529 | } elseif ($this->review_requested_at !== null) { |
530 | 530 | $status = 'submitted'; |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | public function getClassificationMessageAttribute() |
559 | 559 | { |
560 | 560 | if ($this->classification_id !== null && $this->classification_level !== null) { |
561 | - return $this->classification->key . '-0' . $this->classification_level; |
|
561 | + return $this->classification->key.'-0'.$this->classification_level; |
|
562 | 562 | } |
563 | 563 | return null; |
564 | 564 | } |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | */ |
572 | 572 | public function toApiArray(): array |
573 | 573 | { |
574 | - $jobWithTranslations = array_merge($this->toArray(), $this->getTranslationsArray()); |
|
574 | + $jobWithTranslations = array_merge ($this->toArray (), $this->getTranslationsArray ()); |
|
575 | 575 | return $jobWithTranslations; |
576 | 576 | } |
577 | 577 | } |
@@ -37,6 +37,6 @@ |
||
37 | 37 | |
38 | 38 | public function team_culture() //phpcs:ignore |
39 | 39 | { |
40 | - return $this->belongsTo(\App\Models\TeamCulture::class); |
|
40 | + return $this->belongsTo (\App\Models\TeamCulture::class); |
|
41 | 41 | } |
42 | 42 | } |