OpenXE/classes/Modules/RoleSurvey/Bootstrap.php
2022-05-17 23:06:47 +02:00

66 lines
1.4 KiB
PHP

<?php
declare(strict_types=1);
namespace Xentral\Modules\RoleSurvey;
use Xentral\Core\DependencyInjection\ContainerInterface;
final class Bootstrap
{
/**
* @return array
*/
public static function registerServices(): array
{
return [
'SurveyGateway' => 'onInitSurveyGateway',
'SurveyService' => 'onInitSurveyService',
];
}
/**
* @return array
*/
public static function registerJavascript(): array
{
return [
'RoleSurvey' => [
'./classes/Modules/RoleSurvey/www/js/RoleSurvey.js',
],
];
}
/**
* @return array
*/
public static function registerStylesheets(): array
{
return [
'RoleSurvey' => [
'./classes/Modules/RoleSurvey/www/css/RoleSurvey.css',
],
];
}
/**
* @param ContainerInterface $container
*
* @return SurveyService
*/
public static function onInitSurveyService(ContainerInterface $container): SurveyService
{
return new SurveyService($container->get('Database'), $container->get('SurveyGateway'));
}
/**
* @param ContainerInterface $container
*
* @return SurveyGateway
*/
public static function onInitSurveyGateway(ContainerInterface $container): SurveyGateway
{
return new SurveyGateway($container->get('Database'));
}
}