Passed
Push — master ( f218e6...f51c1b )
by Arthur
04:59
created

UserSeeder::runDemo()   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 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Modules\User\Database\Seeders;
4
5
use Auth0\Login\Contract\Auth0UserRepository;
6
use Foundation\Contracts\DemoSeederContract;
7
use Illuminate\Database\Seeder;
8
use Modules\Auth0\Services\Auth0Service;
9
use Modules\Authorization\Entities\Role;
10
use Modules\User\Entities\User;
11
12
class UserSeeder extends Seeder implements DemoSeederContract
13
{
14
    /**
15
     * @var int
16
     */
17
    public $priority = 1;
18
19
    /**
20
     * @var Auth0Service
21
     */
22
    protected $service;
23
24
    /**
25
     * UserSeeder constructor.
26
     *
27
     * @param $service
28
     */
29
    public function __construct(Auth0UserRepository $service)
30
    {
31
        $this->service = $service;
0 ignored issues
show
Documentation Bug introduced by
$service is of type Auth0\Login\Contract\Auth0UserRepository, but the property $service was declared to be of type Modules\Auth0\Services\Auth0Service. Are you sure that you always receive this specific sub-class here, or does it make sense to add an instanceof check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.

Either this assignment is in error or an instanceof check should be added for that assignment.

class Alien {}

class Dalek extends Alien {}

class Plot
{
    /** @var  Dalek */
    public $villain;
}

$alien = new Alien();
$plot = new Plot();
if ($alien instanceof Dalek) {
    $plot->villain = $alien;
}
Loading history...
32
    }
33
34
    /**
35
     * Run the database seeds.
36
     *
37
     * @return void
38
     */
39
    public function run()
40
    {
41
        // $this->service->getTestUser();
42
43
    }
44
45
    public function runDemo()
46
    {
47
        factory(User::class, 5)->create();
48
    }
49
50
51
}
52