Completed
Push — master ( 6c1318...fd4dfb )
by Mahmoud
03:00
created

AssignRoleAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A run() 0 4 1
1
<?php
2
3
namespace App\Containers\Authorization\Actions;
4
5
use App\Containers\Authorization\Tasks\AssignRoleTask;
6
use App\Port\Action\Abstracts\Action;
7
8
/**
9
 * Class AssignRoleAction.
10
 *
11
 * @author Mahmoud Zalt <[email protected]>
12
 */
13
class AssignRoleAction extends Action
14
{
15
16
    /**
17
     * @var  \App\Containers\Authorization\Data\Repositories\AssignRoleTask
18
     */
19
    private $assignRoleTask;
20
21
    /**
22
     * GetAdminRoleAction constructor.
23
     *
24
     * @param \App\Containers\Authorization\Data\Repositories\AssignRoleTask $assignRoleTask
25
     */
26
    public function __construct(AssignRoleTask $assignRoleTask)
27
    {
28
        $this->assignRoleTask = $assignRoleTask;
0 ignored issues
show
Documentation Bug introduced by
It seems like $assignRoleTask of type object<App\Containers\Au...n\Tasks\AssignRoleTask> is incompatible with the declared type object<App\Containers\Au...itories\AssignRoleTask> of property $assignRoleTask.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
29
    }
30
31
    /**
32
     * @param $userId
33
     * @param $roleName
34
     */
35
    public function run($userId, $roleName)
36
    {
37
        return $this->assignRoleTask->run($userId, $roleName);
38
    }
39
}
40