@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | protected function array_any(array $array, callable $fn) |
28 | 28 | { |
29 | 29 | foreach ($array as $value) { |
30 | - if ($fn($value)) { |
|
30 | + if ($fn ($value)) { |
|
31 | 31 | return true; |
32 | 32 | } |
33 | 33 | } |
@@ -46,13 +46,13 @@ discard block |
||
46 | 46 | // debugbar()->debug($value); |
47 | 47 | // debugbar()->debug($this->attributeName); |
48 | 48 | // debugbar()->debug($this->attributeValue); |
49 | - return $this->array_any($value, function ($object) { |
|
49 | + return $this->array_any ($value, function ($object){ |
|
50 | 50 | return $object[$this->attributeName] == $this->attributeValue; |
51 | 51 | }); |
52 | 52 | } |
53 | 53 | |
54 | 54 | public function message() |
55 | 55 | { |
56 | - return Lang::get('validation.contains_object_with_attribute', ['relation' => $this->attributeName, 'attributeValue' => $this->attributeValue]); |
|
56 | + return Lang::get ('validation.contains_object_with_attribute', ['relation' => $this->attributeName, 'attributeValue' => $this->attributeValue]); |
|
57 | 57 | } |
58 | 58 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | { |
9 | 9 | public function validate($request) |
10 | 10 | { |
11 | - abort(404, 'incomplete'); |
|
11 | + abort (404, 'incomplete'); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | public function rules() |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | ]; |
22 | 22 | } |
23 | 23 | |
24 | - public function messages() { |
|
25 | - return Lang::get('validation.custom.password'); |
|
24 | + public function messages(){ |
|
25 | + return Lang::get ('validation.custom.password'); |
|
26 | 26 | } |
27 | 27 | } |
@@ -14,13 +14,13 @@ |
||
14 | 14 | */ |
15 | 15 | public function run() |
16 | 16 | { |
17 | - $skills = Skill::all(); |
|
17 | + $skills = Skill::all (); |
|
18 | 18 | |
19 | 19 | foreach ($skills as $skill) { |
20 | - $skill->classifications()->attach(Classification::inRandomOrder()->first()); |
|
21 | - $skill->is_culture_skill = (bool)random_int(0, 1); |
|
22 | - $skill->is_future_skill = (bool)random_int(0, 1); |
|
23 | - $skill->save(); |
|
20 | + $skill->classifications ()->attach (Classification::inRandomOrder ()->first ()); |
|
21 | + $skill->is_culture_skill = (bool)random_int (0, 1); |
|
22 | + $skill->is_future_skill = (bool)random_int (0, 1); |
|
23 | + $skill->save (); |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 | } |
@@ -6,31 +6,31 @@ |
||
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 | - 'name' => $faker->name(), |
|
12 | - 'email' => $faker->safeEmail(), |
|
13 | - 'description' => $faker->paragraphs(2, true), |
|
14 | - 'relationship_id' => Relationship::inRandomOrder()->first()->id, |
|
15 | - 'applicant_id' => function () { |
|
16 | - return factory(Applicant::class)->create()->id; |
|
11 | + 'name' => $faker->name (), |
|
12 | + 'email' => $faker->safeEmail (), |
|
13 | + 'description' => $faker->paragraphs (2, true), |
|
14 | + 'relationship_id' => Relationship::inRandomOrder ()->first ()->id, |
|
15 | + 'applicant_id' => function (){ |
|
16 | + return factory (Applicant::class)->create ()->id; |
|
17 | 17 | }, |
18 | 18 | ]; |
19 | 19 | }); |
20 | 20 | |
21 | -$factory->define(Project::class, function (Faker $faker) { |
|
21 | +$factory->define (Project::class, function (Faker $faker){ |
|
22 | 22 | return [ |
23 | - 'name' => $faker->sentence(), |
|
24 | - 'start_date' => $faker->dateTimeBetween('-3 years', '-1 years'), |
|
25 | - 'end_date' => $faker->dateTimeBetween('-1 years', '-1 day'), |
|
26 | - 'applicant_id' => function () { |
|
27 | - return factory(Applicant::class)->create()->id; |
|
23 | + 'name' => $faker->sentence (), |
|
24 | + 'start_date' => $faker->dateTimeBetween ('-3 years', '-1 years'), |
|
25 | + 'end_date' => $faker->dateTimeBetween ('-1 years', '-1 day'), |
|
26 | + 'applicant_id' => function (){ |
|
27 | + return factory (Applicant::class)->create ()->id; |
|
28 | 28 | }, |
29 | 29 | ]; |
30 | 30 | }); |
31 | 31 | |
32 | -$factory->afterCreating(Reference::class, function ($reference) : void { |
|
33 | - $reference->projects()->saveMany(factory(Project::class, 3)->make([ |
|
32 | +$factory->afterCreating (Reference::class, function ($reference) : void { |
|
33 | + $reference->projects ()->saveMany (factory (Project::class, 3)->make ([ |
|
34 | 34 | 'applicant_id' => $reference->applicant_id |
35 | 35 | ])); |
36 | 36 | }); |
@@ -5,12 +5,12 @@ |
||
5 | 5 | use App\Models\RatingGuideQuestion; |
6 | 6 | use App\Models\JobPoster; |
7 | 7 | |
8 | -$factory->define(RatingGuideQuestion::class, function (Faker\Generator $faker) { |
|
8 | +$factory->define (RatingGuideQuestion::class, function (Faker\Generator $faker){ |
|
9 | 9 | return [ |
10 | - 'job_poster_id' => function () { |
|
11 | - return factory(JobPoster::class)->create()->id; |
|
10 | + 'job_poster_id' => function (){ |
|
11 | + return factory (JobPoster::class)->create ()->id; |
|
12 | 12 | }, |
13 | - 'assessment_type_id' => AssessmentType::inRandomOrder()->first()->id, |
|
14 | - 'question' => $faker->sentence(), |
|
13 | + 'assessment_type_id' => AssessmentType::inRandomOrder ()->first ()->id, |
|
14 | + 'question' => $faker->sentence (), |
|
15 | 15 | ]; |
16 | 16 | }); |
@@ -5,12 +5,12 @@ |
||
5 | 5 | use App\Models\Skill; |
6 | 6 | use App\Models\Criteria; |
7 | 7 | |
8 | -$factory->define(RatingGuideAnswer::class, function (Faker\Generator $faker) { |
|
8 | +$factory->define (RatingGuideAnswer::class, function (Faker\Generator $faker){ |
|
9 | 9 | return [ |
10 | - 'rating_guide_question_id' => function () { |
|
11 | - return factory(RatingGuideQuestion::class)->create()->id; |
|
10 | + 'rating_guide_question_id' => function (){ |
|
11 | + return factory (RatingGuideQuestion::class)->create ()->id; |
|
12 | 12 | }, |
13 | 13 | 'criterion_id' => null, |
14 | - 'expected_answer' => $faker->sentence(), |
|
14 | + 'expected_answer' => $faker->sentence (), |
|
15 | 15 | ]; |
16 | 16 | }); |
@@ -5,14 +5,14 @@ |
||
5 | 5 | use App\Models\JobApplication; |
6 | 6 | use App\Models\JobApplicationAnswer; |
7 | 7 | |
8 | -$factory->define(JobApplicationAnswer::class, function (Faker\Generator $faker) { |
|
8 | +$factory->define (JobApplicationAnswer::class, function (Faker\Generator $faker){ |
|
9 | 9 | return [ |
10 | - 'job_poster_question_id' => function () { |
|
11 | - return factory(JobPosterQuestion::class)->create()->id; |
|
10 | + 'job_poster_question_id' => function (){ |
|
11 | + return factory (JobPosterQuestion::class)->create ()->id; |
|
12 | 12 | }, |
13 | - 'job_application_id' => function () { |
|
14 | - return factory(JobApplication::class)->create()->id; |
|
13 | + 'job_application_id' => function (){ |
|
14 | + return factory (JobApplication::class)->create ()->id; |
|
15 | 15 | }, |
16 | - 'answer' => $faker->paragraph() |
|
16 | + 'answer' => $faker->paragraph () |
|
17 | 17 | ]; |
18 | 18 | }); |
@@ -6,14 +6,14 @@ |
||
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 | - 'skill_id' => Skill::inRandomOrder()->first()->id, |
|
12 | - 'skill_status_id' => SkillStatus::inRandomOrder()->first()->id, |
|
13 | - 'skill_level_id' => SkillLevel::inRandomOrder()->first()->id, |
|
14 | - 'applicant_id' => function () { |
|
15 | - return factory(Applicant::class)->create()->id; |
|
11 | + 'skill_id' => Skill::inRandomOrder ()->first ()->id, |
|
12 | + 'skill_status_id' => SkillStatus::inRandomOrder ()->first ()->id, |
|
13 | + 'skill_level_id' => SkillLevel::inRandomOrder ()->first ()->id, |
|
14 | + 'applicant_id' => function (){ |
|
15 | + return factory (Applicant::class)->create ()->id; |
|
16 | 16 | }, |
17 | - 'description' => $faker->paragraphs(3, true), |
|
17 | + 'description' => $faker->paragraphs (3, true), |
|
18 | 18 | ]; |
19 | 19 | }); |
@@ -10,39 +10,39 @@ |
||
10 | 10 | use App\Models\JobApplicationAnswer; |
11 | 11 | use App\Models\SkillDeclaration; |
12 | 12 | |
13 | -$factory->define(JobApplication::class, function (Faker\Generator $faker) { |
|
13 | +$factory->define (JobApplication::class, function (Faker\Generator $faker){ |
|
14 | 14 | return [ |
15 | - 'job_poster_id' => function () { |
|
16 | - return factory(JobPoster::class)->states('published')->create()->id; |
|
15 | + 'job_poster_id' => function (){ |
|
16 | + return factory (JobPoster::class)->states ('published')->create ()->id; |
|
17 | 17 | }, |
18 | - 'application_status_id' => ApplicationStatus::where('name', 'submitted')->firstOrFail()->id, |
|
19 | - 'citizenship_declaration_id' => CitizenshipDeclaration::inRandomOrder()->first()->id, |
|
20 | - 'veteran_status_id' => VeteranStatus::inRandomOrder()->first()->id, |
|
21 | - 'preferred_language_id' => PreferredLanguage::inRandomOrder()->first()->id, |
|
22 | - 'submission_signature' => $faker->name(), |
|
23 | - 'submission_date' => $faker->dateTimeBetween('yesterday', 'tomorrow')->format('Y-m-d H:i:s'), |
|
24 | - 'applicant_id' => function () { |
|
25 | - return factory(Applicant::class)->create()->id; |
|
18 | + 'application_status_id' => ApplicationStatus::where ('name', 'submitted')->firstOrFail ()->id, |
|
19 | + 'citizenship_declaration_id' => CitizenshipDeclaration::inRandomOrder ()->first ()->id, |
|
20 | + 'veteran_status_id' => VeteranStatus::inRandomOrder ()->first ()->id, |
|
21 | + 'preferred_language_id' => PreferredLanguage::inRandomOrder ()->first ()->id, |
|
22 | + 'submission_signature' => $faker->name (), |
|
23 | + 'submission_date' => $faker->dateTimeBetween ('yesterday', 'tomorrow')->format ('Y-m-d H:i:s'), |
|
24 | + 'applicant_id' => function (){ |
|
25 | + return factory (Applicant::class)->create ()->id; |
|
26 | 26 | } |
27 | 27 | ]; |
28 | 28 | }); |
29 | 29 | |
30 | -$factory->state(JobApplication::class, 'draft', [ |
|
31 | - 'application_status_id' => ApplicationStatus::where('name', 'draft')->firstOrFail()->id, |
|
30 | +$factory->state (JobApplication::class, 'draft', [ |
|
31 | + 'application_status_id' => ApplicationStatus::where ('name', 'draft')->firstOrFail ()->id, |
|
32 | 32 | 'submission_signature' => null, |
33 | 33 | 'submission_date' => null |
34 | 34 | ]); |
35 | 35 | |
36 | -$factory->afterCreating(JobApplication::class, function ($application) : void { |
|
36 | +$factory->afterCreating (JobApplication::class, function ($application) : void { |
|
37 | 37 | foreach ($application->job_poster->job_poster_questions as $question) { |
38 | - $answer = factory(JobApplicationAnswer::class)->create([ |
|
38 | + $answer = factory (JobApplicationAnswer::class)->create ([ |
|
39 | 39 | 'job_poster_question_id' => $question->id, |
40 | 40 | 'job_application_id' => $application->id |
41 | 41 | ]); |
42 | - $application->job_application_answers()->save($answer); |
|
42 | + $application->job_application_answers ()->save ($answer); |
|
43 | 43 | } |
44 | 44 | foreach ($application->job_poster->criteria as $criterion) { |
45 | - factory(SkillDeclaration::class)->create([ |
|
45 | + factory (SkillDeclaration::class)->create ([ |
|
46 | 46 | 'skill_id' => $criterion->skill_id, |
47 | 47 | 'applicant_id' => $application->applicant_id, |
48 | 48 | ]); |