From 97922a09528a171537b7db7514f051b203c101bb Mon Sep 17 00:00:00 2001 From: Mattia Basone Date: Tue, 30 Nov 2021 17:21:44 +0100 Subject: [PATCH] update dependency injection configuration --- .../DependencyInjection/Configuration.php | 8 ------- .../PatchManagerExtension.php | 24 ------------------- 2 files changed, 32 deletions(-) diff --git a/src/PatchManager/Bundle/DependencyInjection/Configuration.php b/src/PatchManager/Bundle/DependencyInjection/Configuration.php index f3cf594..418d93c 100644 --- a/src/PatchManager/Bundle/DependencyInjection/Configuration.php +++ b/src/PatchManager/Bundle/DependencyInjection/Configuration.php @@ -20,14 +20,6 @@ public function getConfigTreeBuilder(): TreeBuilder ->arrayNode('handlers') ->addDefaultsIfNotSet() ->children() - ->arrayNode('data') - ->addDefaultsIfNotSet() - ->children() - ->scalarNode('entity_manager')->defaultValue('default')->end() - ->scalarNode('doctrine')->defaultTrue()->end() - ->scalarNode('magic_call')->defaultFalse()->end() - ->end() - ->end() ->scalarNode('state_machine')->end() ->end() ->end() diff --git a/src/PatchManager/Bundle/DependencyInjection/PatchManagerExtension.php b/src/PatchManager/Bundle/DependencyInjection/PatchManagerExtension.php index 41f4731..7ce4684 100644 --- a/src/PatchManager/Bundle/DependencyInjection/PatchManagerExtension.php +++ b/src/PatchManager/Bundle/DependencyInjection/PatchManagerExtension.php @@ -54,36 +54,12 @@ private function handleGenericConfig( if (!is_null($config['alias'])) { $container->setAlias($config['alias'], 'patch_manager'); } - if (array_key_exists('data', $config['handlers'])) { - $this->handleData($config, $loaderHandlers, $container); - } if (array_key_exists('state_machine', $config['handlers'])) { $this->handleStateMachine($loaderHandlers, $container); } $container->setParameter('patch_manager.strict_mode', $config['strict_mode']); } - /** - * @param array $config - * @param Loader\XmlFileLoader $loaderHandlers - * @param ContainerBuilder $container - */ - private function handleData(array $config, Loader\XmlFileLoader $loaderHandlers, ContainerBuilder $container): void - { - if ($config['handlers']['data']['doctrine']) { - $loaderHandlers->load('data_doctrine.xml'); - $doctrineEMName = sprintf('doctrine.orm.%s_entity_manager', $config['handlers']['data']['entity_manager']); - $dataDoctrineDefinition = $container->getDefinition('patch_manager.handler.data'); - $dataDoctrineDefinition->addArgument( - new Reference($doctrineEMName) - ); - } else { - $loaderHandlers->load('data.xml'); - } - $dataHandlerDefinition = $container->getDefinition('patch_manager.handler.data'); - $dataHandlerDefinition->addTag('patch_manager.handler'); - } - /** * @param Loader\XmlFileLoader $loaderHandlers * @param ContainerBuilder $container