GetGroupsFromRoleCommandHandler::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 10
cc 1
nc 1
nop 1
crap 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