@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | use App\Models\Degree; |
6 | 6 | use App\Models\Lookup\DegreeType; |
7 | 7 | |
8 | -$factory->define(Degree::class, function (Faker $faker) { |
|
8 | +$factory->define(Degree::class, function(Faker $faker){ |
|
9 | 9 | return [ |
10 | 10 | 'degree_type_id' => DegreeType::inRandomOrder()->first()->id, |
11 | 11 | 'area_of_study' => $faker->word(), |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | 'thesis' => $faker->sentence(), |
14 | 14 | 'start_date' => $faker->dateTimeBetween('-3 years', '-1 years'), |
15 | 15 | 'end_date' => $faker->dateTimeBetween('-1 years', '-1 day'), |
16 | - 'degreeable_id' => function () { |
|
16 | + 'degreeable_id' => function(){ |
|
17 | 17 | // Default factory degrees to belong to Applicant, not JobApplication |
18 | 18 | return factory(Applicant::class)->create()->id; |
19 | 19 | }, |
@@ -5,14 +5,14 @@ |
||
5 | 5 | use App\Models\Course; |
6 | 6 | use App\Models\Lookup\CourseStatus; |
7 | 7 | |
8 | -$factory->define(Course::class, function (Faker $faker) { |
|
8 | +$factory->define(Course::class, function(Faker $faker){ |
|
9 | 9 | return [ |
10 | 10 | 'name' => $faker->word(), |
11 | 11 | 'institution' => $faker->company(), |
12 | 12 | 'course_status_id' => CourseStatus::inRandomOrder()->first()->id, |
13 | 13 | 'start_date' => $faker->dateTimeBetween('-3 years', '-1 years'), |
14 | 14 | 'end_date' => $faker->dateTimeBetween('-1 years', '-1 day'), |
15 | - 'courseable_id' => function () { |
|
15 | + 'courseable_id' => function(){ |
|
16 | 16 | // Default factory item to belong to Applicant, not JobApplication |
17 | 17 | return factory(Applicant::class)->create()->id; |
18 | 18 | }, |
@@ -6,12 +6,12 @@ |
||
6 | 6 | use App\Models\Lookup\SkillLevel; |
7 | 7 | use App\Models\Applicant; |
8 | 8 | |
9 | -$factory->define(SkillDeclaration::class, function (Faker\Generator $faker) { |
|
9 | +$factory->define(SkillDeclaration::class, function(Faker\Generator $faker){ |
|
10 | 10 | return [ |
11 | 11 | 'skill_id' => Skill::inRandomOrder()->first()->id, |
12 | 12 | 'skill_status_id' => SkillStatus::inRandomOrder()->first()->id, |
13 | 13 | 'skill_level_id' => SkillLevel::inRandomOrder()->first()->id, |
14 | - 'skillable_id' => function () { |
|
14 | + 'skillable_id' => function(){ |
|
15 | 15 | return factory(Applicant::class)->create()->id; |
16 | 16 | }, |
17 | 17 | 'skillable_type' => 'applicant', |
@@ -6,13 +6,13 @@ discard block |
||
6 | 6 | use App\Models\Applicant; |
7 | 7 | use App\Models\Project; |
8 | 8 | |
9 | -$factory->define(Reference::class, function (Faker $faker) { |
|
9 | +$factory->define(Reference::class, function(Faker $faker){ |
|
10 | 10 | return [ |
11 | 11 | 'name' => $faker->name(), |
12 | 12 | 'email' => $faker->safeEmail(), |
13 | 13 | 'description' => $faker->paragraphs(2, true), |
14 | 14 | 'relationship_id' => Relationship::inRandomOrder()->first()->id, |
15 | - 'referenceable_id' => function () { |
|
15 | + 'referenceable_id' => function(){ |
|
16 | 16 | // Default factory references to belong to Applicant, not JobApplication. |
17 | 17 | return factory(Applicant::class)->create()->id; |
18 | 18 | }, |
@@ -20,12 +20,12 @@ discard block |
||
20 | 20 | ]; |
21 | 21 | }); |
22 | 22 | |
23 | -$factory->define(Project::class, function (Faker $faker) { |
|
23 | +$factory->define(Project::class, function(Faker $faker){ |
|
24 | 24 | return [ |
25 | 25 | 'name' => $faker->sentence(), |
26 | 26 | 'start_date' => $faker->dateTimeBetween('-3 years', '-1 years'), |
27 | 27 | 'end_date' => $faker->dateTimeBetween('-1 years', '-1 day'), |
28 | - 'projectable_id' => function () { |
|
28 | + 'projectable_id' => function(){ |
|
29 | 29 | // Default factory references to belong to Applicant, not JobApplication. |
30 | 30 | return factory(Applicant::class)->create()->id; |
31 | 31 | }, |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | ]; |
34 | 34 | }); |
35 | 35 | |
36 | -$factory->afterCreating(Reference::class, function ($reference) : void { |
|
36 | +$factory->afterCreating(Reference::class, function($reference) : void { |
|
37 | 37 | $reference->projects()->saveMany(factory(Project::class, 3)->make([ |
38 | 38 | 'projectable_id' => $reference->referenceable_id, |
39 | 39 | 'projectable_type' => 'applicant' |
@@ -5,14 +5,14 @@ |
||
5 | 5 | use App\Models\Lookup\FileType; |
6 | 6 | use App\Models\WorkSample; |
7 | 7 | |
8 | -$factory->define(WorkSample::class, function (Faker $faker) { |
|
8 | +$factory->define(WorkSample::class, function(Faker $faker){ |
|
9 | 9 | return [ |
10 | 10 | 'name' => $faker->words(3, true), |
11 | 11 | 'file_type_id' => FileType::inRandomOrder()->first()->id, |
12 | 12 | 'url' => $faker->url(), |
13 | 13 | 'description' => $faker->paragraph(), |
14 | 14 | 'date_created' => $faker->dateTimeBetween('-3 years', '-1 years'), |
15 | - 'work_sampleable_id' => function () { |
|
15 | + 'work_sampleable_id' => function(){ |
|
16 | 16 | // Factory items to belong to Applicant by default, not JobApplication |
17 | 17 | return factory(Applicant::class)->create()->id; |
18 | 18 | }, |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | public function meetsEssentialCriteria(): bool |
261 | 261 | { |
262 | 262 | $essentialCriteria = $this->job_poster->criteria->filter( |
263 | - function ($value, $key) { |
|
263 | + function($value, $key){ |
|
264 | 264 | return $value->criteria_type->name == 'essential'; |
265 | 265 | } |
266 | 266 | ); |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | $this->courses()->saveMany($applicant->courses->map->replicate()); |
315 | 315 | $this->work_experiences()->saveMany($applicant->work_experiences->map->replicate()); |
316 | 316 | |
317 | - $copyWithHistory = function ($model) { |
|
317 | + $copyWithHistory = function($model){ |
|
318 | 318 | return [ |
319 | 319 | 'old' => $model, |
320 | 320 | 'new' => $model->replicate() |
@@ -333,19 +333,19 @@ discard block |
||
333 | 333 | $this->work_samples()->saveMany($workSampleMap->pluck('new')); |
334 | 334 | $this->skill_declarations()->saveMany($skillDeclarationMap->pluck('new')); |
335 | 335 | |
336 | - $findNewFromOld = function ($mapping, $old) { |
|
337 | - $matchingItem = $mapping->first(function ($value) use ($old) { |
|
336 | + $findNewFromOld = function($mapping, $old){ |
|
337 | + $matchingItem = $mapping->first(function($value) use ($old) { |
|
338 | 338 | return $value['old']->id === $old->id; |
339 | 339 | }); |
340 | 340 | return $matchingItem['new']; |
341 | 341 | }; |
342 | 342 | |
343 | 343 | // Replicate copies shallow attributes, but not relationships. We have to copy those ourselves. |
344 | - $findNewReferenceFromOld = function ($old) use ($findNewFromOld, $referenceMap) { |
|
344 | + $findNewReferenceFromOld = function($old) use ($findNewFromOld, $referenceMap) { |
|
345 | 345 | return $findNewFromOld($referenceMap, $old); |
346 | 346 | }; |
347 | 347 | |
348 | - $findNewSkillDeclarationFromOld = function ($old) use ($findNewFromOld, $skillDeclarationMap) { |
|
348 | + $findNewSkillDeclarationFromOld = function($old) use ($findNewFromOld, $skillDeclarationMap) { |
|
349 | 349 | return $findNewFromOld($skillDeclarationMap, $old); |
350 | 350 | }; |
351 | 351 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * @property \App\Models\Lookup\CourseStatus $course_status |
26 | 26 | * @property \App\Models\Applicant|\App\Models\JobApplication $courseable |
27 | 27 | */ |
28 | -class Course extends BaseModel { |
|
28 | +class Course extends BaseModel{ |
|
29 | 29 | |
30 | 30 | protected $casts = [ |
31 | 31 | 'name' => 'string', |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | 'end_date' |
43 | 43 | ]; |
44 | 44 | |
45 | - public function course_status() { |
|
45 | + public function course_status(){ |
|
46 | 46 | return $this->belongsTo(\App\Models\Lookup\CourseStatus::class); |
47 | 47 | } |
48 | 48 | |
49 | - public function courseable() { |
|
49 | + public function courseable(){ |
|
50 | 50 | return $this->morphTo(); |
51 | 51 | } |
52 | 52 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @property \App\Models\Applicant|\App\Models\JobApplication $projectable |
23 | 23 | */ |
24 | -class Project extends BaseModel { |
|
24 | +class Project extends BaseModel{ |
|
25 | 25 | |
26 | 26 | protected $casts = [ |
27 | 27 | 'name' => 'string', |
@@ -35,11 +35,11 @@ discard block |
||
35 | 35 | 'end_date' |
36 | 36 | ]; |
37 | 37 | |
38 | - public function references() { |
|
38 | + public function references(){ |
|
39 | 39 | return $this->belongsToMany(\App\Models\Reference::class); |
40 | 40 | } |
41 | 41 | |
42 | - public function projectable() { |
|
42 | + public function projectable(){ |
|
43 | 43 | return $this->morphTo(); |
44 | 44 | } |
45 | 45 | } |
@@ -41,11 +41,11 @@ |
||
41 | 41 | $type = Relation::getMorphedModel($type); |
42 | 42 | } |
43 | 43 | |
44 | - if (! class_exists($type)) { |
|
44 | + if (!class_exists($type)) { |
|
45 | 45 | return false; |
46 | 46 | } |
47 | 47 | |
48 | - return ! empty(resolve($type)->find($value)); |
|
48 | + return !empty(resolve($type)->find($value)); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |