Passed
Push — feature/add-2fa-support ( f7b805...d20abf )
by Grant
18:01 queued 08:21
created
database/factories/CriteriaFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@
 block discarded – undo
8 8
 
9 9
 $faker_fr = Faker\Factory::create('fr');
10 10
 
11
-$factory->define(Criteria::class, function (Faker\Generator $faker) use ($faker_fr) {
11
+$factory->define(Criteria::class, function(Faker\Generator $faker) use ($faker_fr) {
12 12
     return [
13 13
         'criteria_type_id' => CriteriaType::inRandomOrder()->first()->id,
14
-        'job_poster_id' => function () {
14
+        'job_poster_id' => function() {
15 15
             return factory(JobPoster::class)->create()->id;
16 16
         },
17 17
         'skill_id' => Skill::inRandomOrder()->first()->id,
Please login to merge, or discard this patch.
database/factories/SkillDeclarationFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,12 +6,12 @@
 block discarded – undo
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
-        'applicant_id' => function () {
14
+        'applicant_id' => function() {
15 15
             return factory(Applicant::class)->create()->id;
16 16
         },
17 17
         'description' => $faker->paragraphs(3, true),
Please login to merge, or discard this patch.
database/factories/UserFactory.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -23,14 +23,14 @@  discard block
 block discarded – undo
23 23
 
24 24
 $faker_fr = Faker\Factory::create('fr');
25 25
 
26
-$factory->define(User::class, function (Faker\Generator $faker) {
26
+$factory->define(User::class, function(Faker\Generator $faker) {
27 27
     static $password;
28 28
 
29 29
     return [
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),
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     ];
39 39
 });
40 40
 
41
-$factory->state(User::class, 'upgradedManager', function (Faker\Generator $faker) {
41
+$factory->state(User::class, 'upgradedManager', function(Faker\Generator $faker) {
42 42
     return [
43 43
         'user_role_id' => UserRole::where('name', 'upgradedManager')->first()->id,
44 44
         'gov_email' => $faker->unique()->safeEmail(),
@@ -57,20 +57,20 @@  discard block
 block discarded – undo
57 57
     'is_priority' => true
58 58
 ]);
59 59
 
60
-$factory->define(Applicant::class, function (Faker\Generator $faker) {
60
+$factory->define(Applicant::class, function(Faker\Generator $faker) {
61 61
     return [
62 62
         'twitter_username' => $faker->firstName(),
63 63
         'linkedin_url' => null,
64 64
         'tagline' => $faker->paragraph(),
65 65
         'personal_website' => $faker->url(),
66 66
         'is_snapshot' => false,
67
-        'user_id' => function () {
67
+        'user_id' => function() {
68 68
             return factory(User::class)->states('applicant')->create()->id;
69 69
         },
70 70
     ];
71 71
 });
72 72
 
73
-$factory->define(Manager::class, function (Faker\Generator $faker) use ($faker_fr) {
73
+$factory->define(Manager::class, function(Faker\Generator $faker) use ($faker_fr) {
74 74
     return [
75 75
         'twitter_username' => $faker->firstName(),
76 76
         'linkedin_url' => null,
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         'development_opportunity_frequency_id' => Frequency::inRandomOrder()->first()->id,
82 82
         'refuse_low_value_work_frequency_id' => Frequency::inRandomOrder()->first()->id,
83 83
         'years_experience' => $faker->numberBetween(2, 25),
84
-        'user_id' => function () use ($faker) {
84
+        'user_id' => function() use ($faker) {
85 85
             return factory(User::class)->create([
86 86
                 'gov_email' => $faker->unique()->safeEmail(),
87 87
             ])->id;
@@ -110,12 +110,12 @@  discard block
 block discarded – undo
110 110
 });
111 111
 
112 112
 $factory->state(Manager::class, 'upgraded', [
113
-    'user_id' => function () {
113
+    'user_id' => function() {
114 114
         return factory(User::class)->state('upgradedManager')->create()->id;
115 115
     },
116 116
 ]);
117 117
 
118
-$factory->afterCreating(Manager::class, function ($manager) : void {
118
+$factory->afterCreating(Manager::class, function($manager) : void {
119 119
     $manager->team_culture()->save(factory(TeamCulture::class)->create([
120 120
         'manager_id' => $manager->id,
121 121
     ]));
Please login to merge, or discard this patch.
database/factories/WorkEnvironmentFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,14 +6,14 @@
 block discarded – undo
6 6
 use App\Models\Manager;
7 7
 use App\Models\Lookup\Frequency;
8 8
 
9
-$factory->define(WorkEnvironment::class, function (Faker $faker) {
9
+$factory->define(WorkEnvironment::class, function(Faker $faker) {
10 10
     $faker_fr = FakerFactory::create('fr');
11 11
     return [
12 12
         'telework_allowed_frequency_id' => Frequency::inRandomOrder()->first()->id,
13 13
         'flexible_hours_frequency_id' => Frequency::inRandomOrder()->first()->id,
14 14
         'things_to_know:en' => $faker->paragraph(),
15 15
         'things_to_know:fr' => $faker_fr->paragraph(),
16
-        'manager_id' => function () {
16
+        'manager_id' => function() {
17 17
             return factory(Manager::class)->create()->id;
18 18
         }
19 19
     ];
Please login to merge, or discard this patch.
database/factories/ApplicationFactory.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,9 +10,9 @@  discard block
 block discarded – undo
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 () {
15
+        'job_poster_id' => function() {
16 16
             return factory(JobPoster::class)->states('published')->create()->id;
17 17
         },
18 18
         'application_status_id' => ApplicationStatus::where('name', 'submitted')->firstOrFail()->id,
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
         'preferred_language_id' => PreferredLanguage::inRandomOrder()->first()->id,
22 22
         'submission_signature' => $faker->name(),
23 23
         'submission_date' => $faker->dateTimeBetween('yesterday', 'tomorrow')->format('Y-m-d H:i:s'),
24
-        'applicant_id' => function () {
24
+        'applicant_id' => function() {
25 25
             return factory(Applicant::class)->create()->id;
26 26
         }
27 27
     ];
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
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 38
         $answer = factory(JobApplicationAnswer::class)->create([
39 39
             'job_poster_question_id' => $question->id,
Please login to merge, or discard this patch.
database/factories/AssessmentFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,16 +6,16 @@
 block discarded – undo
6 6
 use App\Models\RatingGuideQuestion;
7 7
 use App\Models\RatingGuideAnswer;
8 8
 
9
-$factory->define(Assessment::class, function (Faker\Generator $faker) {
9
+$factory->define(Assessment::class, function(Faker\Generator $faker) {
10 10
     return [
11
-        'criterion_id' => function () {
11
+        'criterion_id' => function() {
12 12
             return factory(Criteria::class)->create()->id;
13 13
         },
14 14
         'assessment_type_id' => AssessmentType::inRandomOrder()->first()->id,
15 15
     ];
16 16
 });
17 17
 
18
-$factory->afterMakingState(Assessment::class, 'withRatingGuide', function ($assessment, $faker): void {
18
+$factory->afterMakingState(Assessment::class, 'withRatingGuide', function($assessment, $faker): void {
19 19
     // Create a RatingGuideQuestion, and an accompanying RatingGuideAnswer
20 20
     $question = factory(RatingGuideQuestion::class)->create([
21 21
         'job_poster_id' => $assessment->criterion->job_poster_id,
Please login to merge, or discard this patch.
database/factories/JobApplicationAnswerFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,12 +5,12 @@
 block discarded – undo
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 () {
10
+        'job_poster_question_id' => function() {
11 11
             return factory(JobPosterQuestion::class)->create()->id;
12 12
         },
13
-        'job_application_id' => function () {
13
+        'job_application_id' => function() {
14 14
             return factory(JobApplication::class)->create()->id;
15 15
         },
16 16
         'answer' => $faker->paragraph()
Please login to merge, or discard this patch.
database/factories/JobPosterKeyTaskFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,9 +5,9 @@
 block discarded – undo
5 5
 
6 6
 $faker_fr = Faker\Factory::create('fr');
7 7
 
8
-$factory->define(JobPosterKeyTask::class, function (Faker\Generator $faker) use ($faker_fr) {
8
+$factory->define(JobPosterKeyTask::class, function(Faker\Generator $faker) use ($faker_fr) {
9 9
     return [
10
-        'job_poster_id' => function () {
10
+        'job_poster_id' => function() {
11 11
             return factory(JobPoster::class)->create()->id;
12 12
         },
13 13
         'description:en' => $faker->sentence(),
Please login to merge, or discard this patch.
database/factories/ReferenceFactory.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,30 +6,30 @@
 block discarded – undo
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
-        'applicant_id' => function () {
15
+        'applicant_id' => function() {
16 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 23
         'name' => $faker->sentence(),
24 24
         'start_date' => $faker->dateTimeBetween('-3 years', '-1 years'),
25 25
         'end_date' => $faker->dateTimeBetween('-1 years', '-1 day'),
26
-        'applicant_id' => function () {
26
+        'applicant_id' => function() {
27 27
             return factory(Applicant::class)->create()->id;
28 28
         },
29 29
     ];
30 30
 });
31 31
 
32
-$factory->afterCreating(Reference::class, function ($reference) : void {
32
+$factory->afterCreating(Reference::class, function($reference) : void {
33 33
     $reference->projects()->saveMany(factory(Project::class, 3)->make([
34 34
         'applicant_id' => $reference->applicant_id
35 35
     ]));
Please login to merge, or discard this patch.