Completed
Push — master ( 014612...36ad26 )
by Mahmoud
03:39
created

SyncPermissionsOnRoleTask::run()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
namespace App\Containers\Authorization\Tasks;
4
5
use App\Containers\Authorization\Models\Role;
6
use App\Ship\Parents\Tasks\Task;
7
8
/**
9
 * Class SyncPermissionsOnRoleTask.
10
 *
11
 * @author Mahmoud Zalt <[email protected]>
12
 */
13
class SyncPermissionsOnRoleTask extends Task
14
{
15
16
    /**
17
     * @param \App\Containers\Authorization\Models\Role $role
18
     * @param array                                     $permissions
19
     *
20
     * @return  \App\Containers\Authorization\Models\Role
21
     */
22
    public function run(Role $role, Array $permissions)
23
    {
24
        $role = $role->syncPermissions($permissions);
25
26
        return $role;
27
    }
28
}
29