Passed
Push — master ( 3d2565...6e288b )
by CodexShaper
04:16
created

DatabaseManagerSeeder   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 22
rs 10
wmc 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 14 4
1
<?php
2
3
use Illuminate\Database\Seeder;
4
5
class DatabaseManagerSeeder extends Seeder
6
{
7
    protected $seedersPath = __DIR__ . '/../../database/seeds/';
8
    /**
9
     * Seed the application's database.
10
     *
11
     * @return void
12
     */
13
    public function run()
14
    {
15
        $seeds = [
16
            'DatabasePermissionSeeder',
17
            'DatabaseUserPerissionsSeeder',
18
        ];
19
20
        foreach ($seeds as $class) {
21
22
            $file = $this->seedersPath . $class . '.php';
23
            if (file_exists($file) && !class_exists($class)) {
24
                require_once $file;
25
            }
26
            with(new $class())->run();
27
        }
28
    }
29
}
30