23 lines
676 B
PHP
23 lines
676 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);
|
|
|
|
}
|
|
} |