/** * Configure the dependency injection container * * @param DependencyInjectionContainerInterface $diContainer Dependency injection container * @return void */ public function configureDependencyInjection(DependencyInjectionContainerInterface $diContainer) { parent::configureDependencyInjection($diContainer); // Configure the repository service $diContainer->register(Service::class, ['shared' => true, 'substitutions' => [AutoConnectorInterface::class => ['instance' => AutoConnector::class], AdapterStrategyFactoryInterface::class => ['instance' => AdapterStrategyFactory::class], ManagerInterface::class => ['instance' => Manager::class]]]); // Configure the type service $diContainer->register(Type::class, ['substitutions' => [TypeServiceInterface::class => ['instance' => TypeService::class]]]); $diContainer->register(Selector::class, ['substitutions' => [TypeServiceInterface::class => ['instance' => TypeService::class]]]); // Configure the CommonMark payload processor $diContainer->register(AbstractCommonMarkObject::class, ['shared' => false, 'substitutions' => [CommonMarkPayloadProcessorInterface::class => ['instance' => CommonMarkPayloadProcessor::class]]]); // Configure the binary payload processor $diContainer->register(AbstractBinaryObject::class, ['shared' => false, 'substitutions' => [BinaryPayloadProcessorInterface::class => ['instance' => BinaryPayloadProcessor::class]]]); }
/** * Configure the dependency injection container * * @param DependencyInjectionContainerInterface $diContainer Dependency injection container * @return void * @see https://r.je/dice.html#example3-6 */ public function configureDependencyInjection(DependencyInjectionContainerInterface $diContainer) { parent::configureDependencyInjection($diContainer); }