Test Failed
Push — main ( 2036f5...f2d0d3 )
by Proyecto
07:50
created

InMemoryModuleRepository::removeRoleFromModule()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 2
1
<?php
2
3
namespace ProyectoTAU\TAU\Module\Administration\Module\Infrastructure;
4
5
use ProyectoTAU\TAU\Common\InMemoryRepository;
6
use ProyectoTAU\TAU\Module\Administration\Role\Domain\Role;
7
use ProyectoTAU\TAU\Module\Administration\Module\Domain\Module;
8
use ProyectoTAU\TAU\Module\Administration\Module\Domain\ModuleRepository;
9
10
class InMemoryModuleRepository implements ModuleRepository
11
{
12
    public function create(Module $module): void
13
    {
14
        InMemoryRepository::getInstance()->createModule($module);
15
    }
16
17
    public function read($id): Module
18
    {
19
        return InMemoryRepository::getInstance()->readModule($id);
20
    }
21
22
    public function update($id, $name, $desc): void
23
    {
24
        InMemoryRepository::getInstance()->updateModule($id, $name, $desc);
25
    }
26
27
    public function delete($id): void
28
    {
29
        InMemoryRepository::getInstance()->deleteModule($id);
30
    }
31
32
    public function addRoleToModule(Role $role, Module $module): void
33
    {
34
        InMemoryRepository::getInstance()->addRoleToModule($role, $module);
35
    }
36
37
    public function removeRoleFromModule(Role $role, Module $module): void
38
    {
39
        InMemoryRepository::getInstance()->removeRoleFromModule($role, $module);
40
    }
41
42
    public function getRolesFromModule(Module $module): array
43
    {
44
        return InMemoryRepository::getInstance()->getRolesFromModule($module);
45
    }
46
}
47