Completed
Push — feature/job-summary-hr ( 7539f8...7539f8 )
by Grant
18:13 queued 18:04
created

CommentSeeder::run()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 6
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
use App\Models\JobPoster;
4
use Illuminate\Database\Seeder;
5
use Illuminate\Support\Facades\DB;
6
7
class CommentSeeder extends Seeder
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
8
{
9
    /**
10
     * Run the database seeds.
11
     *
12
     * @return void
13
     */
14
    public function run()
0 ignored issues
show
introduced by
Method \CommentSeeder::run() does not have native return type hint for its return value but it should be possible to add it based on @return annotation "void".
Loading history...
15
    {
16
        $job_posters = JobPoster::all();
17
18
        $job_posters->each(function ($job_poster) {
0 ignored issues
show
introduced by
Closure does not have void return type hint.
Loading history...
19
            $job_poster->comments()->save(factory(App\Models\Comment::class)->make());
20
        });
21
    }
22
}
23