| Total Complexity | 8 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class InMemoryModuleRepository implements ModuleRepository |
||
| 11 | { |
||
| 12 | 10 | public function clear(): void |
|
| 13 | { |
||
| 14 | 10 | InMemoryRepository::getInstance()->clearModule(); |
|
| 15 | 10 | } |
|
| 16 | |||
| 17 | 10 | public function create(Module $module): void |
|
| 18 | { |
||
| 19 | 10 | InMemoryRepository::getInstance()->createModule(clone $module); |
|
| 20 | 10 | } |
|
| 21 | |||
| 22 | 9 | public function read($id): Module |
|
| 23 | { |
||
| 24 | 9 | return InMemoryRepository::getInstance()->readModule($id); |
|
| 25 | } |
||
| 26 | |||
| 27 | 1 | public function update($id, $name, $desc): void |
|
| 28 | { |
||
| 29 | 1 | InMemoryRepository::getInstance()->updateModule($id, $name, $desc); |
|
| 30 | 1 | } |
|
| 31 | |||
| 32 | 1 | public function delete($id): void |
|
| 33 | { |
||
| 34 | 1 | InMemoryRepository::getInstance()->deleteModule($id); |
|
| 35 | 1 | } |
|
| 36 | |||
| 37 | 3 | public function addRoleToModule(Role $role, Module $module): void |
|
| 38 | { |
||
| 39 | 3 | InMemoryRepository::getInstance()->addRoleToModule($role, $module); |
|
| 40 | 3 | } |
|
| 41 | |||
| 42 | 1 | public function removeRoleFromModule(Role $role, Module $module): void |
|
| 43 | { |
||
| 44 | 1 | InMemoryRepository::getInstance()->removeRoleFromModule($role, $module); |
|
| 45 | 1 | } |
|
| 46 | |||
| 47 | 3 | public function getRolesFromModule(Module $module): array |
|
| 50 | } |
||
| 51 | } |
||
| 52 |