This commit is contained in:
2023-09-04 23:48:46 +03:00
parent e95c9f744c
commit 09447dd5e9
6 changed files with 73 additions and 11 deletions
+25
View File
@@ -0,0 +1,25 @@
<?php
namespace Bx\Null\Providers;
use Bx\Null\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);
}
}