for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Stu\Module\Control;
use Stu\Component\Game\ModuleViewEnum;
use Stu\Config\Init;
class ControllerDiscovery
{
/**
* @return array<string, ControllerInterface>
*/
public function getControllers(ModuleViewEnum $module, bool $isViewController): array
return Init::getContainer()->get($this->getContainerIdentifier($module, $isViewController));
}
private function getContainerIdentifier(ModuleViewEnum $module, bool $isViewController): string
return sprintf(
'%s_%s',
$module->name,
name
Stu\Component\Game\ModuleViewEnum
$isViewController ? 'VIEWS' : 'ACTIONS'
);