Test Failed
Push — master ( b6687a...d5e75a )
by Julien
06:32
created

LaravelTournamentSeeder   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 4
dl 0
loc 26
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 23 1
1
<?php
2
3
use Illuminate\Database\Eloquent\Model;
4
use Illuminate\Database\Seeder;
5
use Illuminate\Support\Facades\DB;
6
use Xoco70\LaravelTournaments\DBHelpers;
7
8
class LaravelTournamentSeeder 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...
9
{
10
    public function run()
11
    {
12
        Model::unguard();
13
14
        $this->command->info('Seeding...');
15
16
        DBHelpers::setFKCheckOff();
17
18
        DB::table('competitor')->truncate();
19
        DB::table('tournament')->truncate();
20
        DB::table('category')->truncate();
21
        DB::table('users')->truncate();
22
        DB::table('venue')->truncate();
23
24
        $this->call(VenueSeeder::class);
25
        $this->call(CategorySeeder::class);
26
        $this->call(TournamentSeeder::class);
27
        $this->call(CompetitorSeeder::class);
28
29
        $this->command->info('All tables seeded!');
30
        DBHelpers::setFKCheckOn();
31
        Model::reguard();
32
    }
33
}
34