Completed
Push — master ( 730998...f24d78 )
by Mahmoud
03:24
created

DeleteRoleAction::run()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace App\Containers\Authorization\Actions;
4
5
use App\Containers\Authorization\Tasks\DeleteRoleTask;
6
use App\Port\Action\Abstracts\Action;
7
8
/**
9
 * Class DeleteRoleAction.
10
 *
11
 * @author Mahmoud Zalt <[email protected]>
12
 */
13
class DeleteRoleAction extends Action
14
{
15
16
    /**
17
     * @var  \App\Containers\Authorization\Tasks\DeleteRoleTask
18
     */
19
    private $deleteRoleTask;
20
21
    /**
22
     * DeleteRoleAction constructor.
23
     *
24
     * @param \App\Containers\Authorization\Tasks\DeleteRoleTask $deleteRoleTask
25
     */
26
    public function __construct(DeleteRoleTask $deleteRoleTask)
27
    {
28
        $this->deleteRoleTask = $deleteRoleTask;
29
    }
30
31
    /**
32
     * @param $roleId
33
     *
34
     * @return  bool
35
     */
36
    public function run($roleId = null)
37
    {
38
        $isDeleted = $this->deleteRoleTask->run($roleId);
39
40
        return $isDeleted;
41
    }
42
}
43