Passed
Push — task/comments-api ( 19d8e5...25ff28 )
by Chris
45:14 queued 36:01
created
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.
database/factories/JobPosterQuestionFactory.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(JobPosterQuestion::class, function (Faker\Generator $faker) use ($faker_fr) {
8
+$factory->define(JobPosterQuestion::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/RatingGuideAnswerFactory.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
 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 () {
10
+        'rating_guide_question_id' => function() {
11 11
             return factory(RatingGuideQuestion::class)->create()->id;
12 12
         },
13 13
         'criterion_id' => null,
Please login to merge, or discard this patch.
database/factories/TeamCultureFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 use App\Models\TeamCulture;
6 6
 use App\Models\Manager;
7 7
 
8
-$factory->define(TeamCulture::class, function (Faker $faker) {
8
+$factory->define(TeamCulture::class, function(Faker $faker) {
9 9
     $faker_fr = FakerFactory::create('fr');
10 10
     return [
11 11
         'team_size' => $faker->numberBetween(5, 15),
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
         'operating_context:fr' => $faker_fr->paragraph(),
19 19
         'what_we_value:fr' => $faker_fr->paragraph(),
20 20
         'how_we_work:fr' => $faker_fr->paragraph(),
21
-        'manager_id' => function () {
21
+        'manager_id' => function() {
22 22
             return factory(Manager::class)->create()->id;
23 23
         }
24 24
     ];
Please login to merge, or discard this patch.
app/Policies/JobPolicy.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -103,13 +103,13 @@
 block discarded – undo
103 103
             $jobPoster->isClosed();
104 104
     }
105 105
 
106
-     /**
107
-     * Determine whether the user can view the comments.
108
-     *
109
-     * @param \App\Models\User $user
110
-     * @param \App\Models\JobPoster $jobPoster
111
-     * @return bool
112
-     */
106
+        /**
107
+         * Determine whether the user can view the comments.
108
+         *
109
+         * @param \App\Models\User $user
110
+         * @param \App\Models\JobPoster $jobPoster
111
+         * @return bool
112
+         */
113 113
     public function viewComments(User $user, JobPoster $jobPoster) : bool
114 114
     {
115 115
         // Only the manager that created a comment can view the comment.
Please login to merge, or discard this patch.
database/factories/CommentFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,12 +6,12 @@
 block discarded – undo
6 6
 use App\Models\User;
7 7
 use Faker\Generator as Faker;
8 8
 
9
-$factory->define(Comment::class, function (Faker $faker) {
9
+$factory->define(Comment::class, function(Faker $faker) {
10 10
     return [
11
-        'job_poster_id' => function () {
11
+        'job_poster_id' => function() {
12 12
             return factory(JobPoster::class)->create()->id;
13 13
         },
14
-        'user_id' => function () {
14
+        'user_id' => function() {
15 15
             return factory(User::class)->create()->id;
16 16
         },
17 17
         'comment' => $faker->sentence(),
Please login to merge, or discard this patch.
database/factories/UserFactory.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -24,14 +24,14 @@  discard block
 block discarded – undo
24 24
 
25 25
 $faker_fr = Faker\Factory::create('fr');
26 26
 
27
-$factory->define(User::class, function (Faker\Generator $faker) {
27
+$factory->define(User::class, function(Faker\Generator $faker) {
28 28
     static $password;
29 29
 
30 30
     return [
31 31
         'first_name' => $faker->firstName(),
32 32
         'last_name' => $faker->lastName(),
33 33
         'email' => $faker->unique()->safeEmail(),
34
-        'password' => $password ? : $password = Hash::make('password'),
34
+        'password' => $password ?: $password = Hash::make('password'),
35 35
         'is_confirmed' => 1,
36 36
         'user_role_id' => UserRole::where('name', 'basic')->first()->id, // Users should default to basic user role.
37 37
         'remember_token' => str_random(10),
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     ];
40 40
 });
41 41
 
42
-$factory->state(User::class, 'upgradedManager', function (Faker\Generator $faker) {
42
+$factory->state(User::class, 'upgradedManager', function(Faker\Generator $faker) {
43 43
     return [
44 44
         'user_role_id' => UserRole::where('name', 'upgradedManager')->first()->id,
45 45
         'gov_email' => $faker->unique()->safeEmail(),
@@ -66,29 +66,29 @@  discard block
 block discarded – undo
66 66
     'is_priority' => true
67 67
 ]);
68 68
 
69
-$factory->define(Applicant::class, function (Faker\Generator $faker) {
69
+$factory->define(Applicant::class, function(Faker\Generator $faker) {
70 70
     return [
71 71
         'twitter_username' => $faker->firstName(),
72 72
         'linkedin_url' => null,
73 73
         'tagline' => $faker->paragraph(),
74 74
         'personal_website' => $faker->url(),
75 75
         'is_snapshot' => false,
76
-        'user_id' => function () {
76
+        'user_id' => function() {
77 77
             return factory(User::class)->states('applicant')->create()->id;
78 78
         },
79 79
     ];
80 80
 });
81 81
 
82
-$factory->define(HrAdvisor::class, function () {
82
+$factory->define(HrAdvisor::class, function() {
83 83
     return [
84 84
         'department_id' => null,
85
-        'user_id' => function () {
85
+        'user_id' => function() {
86 86
             return factory(User::class)->state('hr_advisor')->create()->id;
87 87
         },
88 88
     ];
89 89
 });
90 90
 
91
-$factory->define(Manager::class, function (Faker\Generator $faker) use ($faker_fr) {
91
+$factory->define(Manager::class, function(Faker\Generator $faker) use ($faker_fr) {
92 92
     return [
93 93
         'twitter_username' => $faker->firstName(),
94 94
         'linkedin_url' => null,
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         'development_opportunity_frequency_id' => Frequency::inRandomOrder()->first()->id,
100 100
         'refuse_low_value_work_frequency_id' => Frequency::inRandomOrder()->first()->id,
101 101
         'years_experience' => $faker->numberBetween(2, 25),
102
-        'user_id' => function () use ($faker) {
102
+        'user_id' => function() use ($faker) {
103 103
             return factory(User::class)->create([
104 104
                 'gov_email' => $faker->unique()->safeEmail(),
105 105
             ])->id;
@@ -128,12 +128,12 @@  discard block
 block discarded – undo
128 128
 });
129 129
 
130 130
 $factory->state(Manager::class, 'upgraded', [
131
-    'user_id' => function () {
131
+    'user_id' => function() {
132 132
         return factory(User::class)->state('upgradedManager')->create()->id;
133 133
     },
134 134
 ]);
135 135
 
136
-$factory->afterCreating(Manager::class, function ($manager) : void {
136
+$factory->afterCreating(Manager::class, function($manager) : void {
137 137
     $manager->team_culture()->save(factory(TeamCulture::class)->create([
138 138
         'manager_id' => $manager->id,
139 139
     ]));
Please login to merge, or discard this patch.