| Total Complexity | 4 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class ControllerDiscovery |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @return array<string, ControllerInterface> |
||
| 12 | */ |
||
| 13 | public function getControllers(ModuleEnum $module, bool $isViewController): array |
||
| 14 | { |
||
| 15 | $controllers = Init::getContainer()->get($this->getContainerIdentifier($module->name, $isViewController)); |
||
|
|
|||
| 16 | |||
| 17 | $commonModule = $module->getCommonModule(); |
||
| 18 | if ($commonModule === null) { |
||
| 19 | return $controllers; |
||
| 20 | } |
||
| 21 | |||
| 22 | return array_merge(Init::getContainer()->get($this->getContainerIdentifier($commonModule, $isViewController)), $controllers); |
||
| 23 | } |
||
| 24 | |||
| 25 | private function getContainerIdentifier(string $module, bool $isViewController): string |
||
| 31 | ); |
||
| 32 | } |
||
| 34 |