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

LaravelTournamentSeeder::run()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 9.0856
c 0
b 0
f 0
cc 1
eloc 16
nc 1
nop 0
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