GetGroupsFromRoleCommandHandler   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 7
c 1
b 0
f 0
dl 0
loc 17
ccs 8
cts 8
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 8 1
A __construct() 0 3 1
1
<?php
2
3
namespace ProyectoTAU\TAU\Module\Administration\Role\Application\getGroupsFromRole;
4
5
use ProyectoTAU\TAU\Module\Administration\Role\Domain\RoleRepository;
6
7
final class GetGroupsFromRoleCommandHandler
8
{
9
    private $roleRepository;
10
11 3
    public function __construct(RoleRepository $role)
12
    {
13 3
        $this->roleRepository = $role;
14 3
    }
15
16 3
    public function handle(GetGroupsFromRoleCommand $command)
17
    {
18 3
        $role = $this->roleRepository->read($command->roleId);
19 3
        $r = $this->roleRepository->getGroupsFromRole($role);
20
21 3
        $role->getGroups();
22
23 3
        return $r;
24
    }
25
}
26