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

DatabaseManagerSeeder::run()   A

Complexity

Conditions 4
Paths 3

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 4
eloc 8
c 1
b 0
f 0
nc 3
nop 0
dl 0
loc 14
rs 10
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