Completed
Push — master ( 17a334...ed601b )
by Mahmoud
02:57
created

RolesSeeder   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 37
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A run() 0 13 1
1
<?php
2
3
namespace App\Containers\Authorization\Data\Seeders;
4
5
use App\Containers\Authorization\Actions\CreateRoleAction;
6
use App\Port\Seeder\Abstracts\Seeder;
7
8
class RolesSeeder extends Seeder
9
{
10
11
    /**
12
     * @var  \App\Containers\Authorization\Actions\CreateRoleAction
13
     */
14
    private $createRoleAction;
15
16
    /**
17
     * RolesSeeder constructor.
18
     *
19
     * @param \App\Containers\Authorization\Actions\CreateRoleAction $createRoleAction
20
     */
21
    public function __construct(CreateRoleAction $createRoleAction)
22
    {
23
        $this->createRoleAction = $createRoleAction;
24
    }
25
26
    /**
27
     * Run the database seeds.
28
     *
29
     * @return void
30
     */
31
    public function run()
32
    {
33
        // Default Roles ----------------------------------------------------------------
34
35
        $this->createRoleAction->run('admin', 'Super Administrator')->givePermissionTo([
36
            'admin-access', 'manage-roles-permissions',
37
        ]);
38
39
        $this->createRoleAction->run('client', 'Normal User');
40
41
        // ...
42
43
    }
44
}
45