Files
bx.nullable/lib/Providers/DefaultFactoryProvider.php
T
2025-03-19 04:49:12 +03:00

25 lines
678 B
PHP

<?php
namespace Bx\Nullable\Providers;
use Bx\Nullable\AbstractFactory\MainAbstractFactory;
use Wt\Core\Interfaces\IApp;
use Wt\Core\Interfaces\IServiceProvider;
class DefaultFactoryProvider implements IServiceProvider
{
public function register(IApp $app)
{
$config = $app->config();
$serviceContainer = $app->container();
/**
* @var MainAbstractFactory $mainAbstractFactory
*/
$mainAbstractFactory = $serviceContainer->make(MainAbstractFactory::class, [$config->get('MainAbstractFactory', [])]);
$serviceContainer->singleton($app->module()->getId().':mainAbstractFactory', $mainAbstractFactory);
}
}