Passed
Push — master ( c3754f...384d2b )
by Stephen
01:41 queued 11s
created

TeamSeeder   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 8
c 2
b 0
f 0
dl 0
loc 16
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 9 1
1
<?php
2
3
namespace Database\Seeders;
4
5
use Illuminate\Database\Seeder;
6
use Sfneal\Users\Models\Team;
7
use Sfneal\Users\Models\User;
8
9
class TeamSeeder extends Seeder
10
{
11
    /**
12
     * Run the database seeds.
13
     *
14
     * @return void
15
     */
16
    public function run()
17
    {
18
        User::query()
19
            ->limit(User::query()->count() / 2)
0 ignored issues
show
Bug introduced by
The method limit() does not exist on Sfneal\Users\Builders\UserBuilder. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
            ->/** @scrutinizer ignore-call */ limit(User::query()->count() / 2)
Loading history...
Bug introduced by
The method count() does not exist on Sfneal\Users\Builders\UserBuilder. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
            ->limit(User::query()->/** @scrutinizer ignore-call */ count() / 2)
Loading history...
20
            ->get()
21
            ->each(function (User $user) {
22
                Team::factory()
23
                    ->create([
24
                        'user_id' => $user->getKey(),
25
                    ]);
26
            });
27
    }
28
}
29