Passed
Push — master ( f51c1b...16736d )
by Arthur
05:36
created

DemoSeeder::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: arthur
5
 * Date: 28.10.18
6
 * Time: 16:15
7
 */
8
9
namespace Modules\Demo\Database\Seeder;
10
11
use Illuminate\Database\Seeder;
12
use Modules\Auth0\Contracts\Auth0ServiceContract;
13
use Modules\Authorization\Entities\Role;
14
use Modules\Machine\Entities\Machine;
15
16
class DemoSeeder extends Seeder
17
{
18
    public $seed = false;
19
20
    public $service;
21
22
    /**
23
     * DemoSeeder constructor.
24
     * @param bool $seed
25
     */
26
    public function __construct(Auth0ServiceContract $auth0Service)
27
    {
28
        $this->service = $auth0Service;
29
    }
30
31
32
    /**
33
     * Run the database seeds.
34
     *
35
     * @return void
36
     */
37
    public function run()
38
    {
39
        $user = $this->service->getTestUser();
40
        $user->assignRole(Role::ADMIN);
41
        $machines = factory(Machine::class, 5)->create([
0 ignored issues
show
Unused Code introduced by
The assignment to $machines is dead and can be removed.
Loading history...
42
            'user_id' => $user->id,
43
        ]);
44
    }
45
}
46