DScanDataSeeder   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 19
c 0
b 0
f 0
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 12 3
1
<?php
2
3
use Illuminate\Database\Seeder;
0 ignored issues
show
Bug introduced by
The type Illuminate\Database\Seeder was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
4
use Illuminate\Support\Facades\DB;
5
6
class DScanDataSeeder extends Seeder
7
{
8
    /**
9
     * Run the database seeds.
10
     *
11
     * @return void
12
     */
13
    public function run()
14
    {
15
        if (DB::connection()->getDriverName() == 'mysql') {
16
        	DB::statement('SET FOREIGN_KEY_CHECKS=0;');
17
        }
18
19
        DB::table('d_scan_datas')->truncate();
20
21
        DB::unprepared(File::get('database/seeds/ships.sql'));
22
23
        if (DB::connection()->getDriverName() == 'mysql') {
24
        	DB::statement('SET FOREIGN_KEY_CHECKS=1;');
25
        }
26
    }
27
}
28