From a6deb6066e0edaea68a1b4efd13434b228c2b12b Mon Sep 17 00:00:00 2001 From: Ben Roberts Date: Sat, 25 May 2024 06:49:52 +0200 Subject: [PATCH] Improve configuration option and parameter names --- src/HeadsnetDoctrineToolsBundle.php | 8 ++++---- src/Types/DoctrineTypesCompilerPass.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/HeadsnetDoctrineToolsBundle.php b/src/HeadsnetDoctrineToolsBundle.php index bddec3d..b54781a 100644 --- a/src/HeadsnetDoctrineToolsBundle.php +++ b/src/HeadsnetDoctrineToolsBundle.php @@ -17,14 +17,14 @@ public function configure(DefinitionConfigurator $definition): void $definition->rootNode() ->children() ->scalarNode('root_namespace')->cannotBeEmpty()->end() - ->arrayNode('preset_types') + ->arrayNode('custom_types') ->canBeDisabled() ->children() ->arrayNode('scan_dirs') ->defaultValue(['src/'])->scalarPrototype()->end() ->end() ->end() - ->end() // End preset_types + ->end() // End custom_types ->arrayNode('custom_mappings') ->children() ->arrayNode('scan_dirs') @@ -44,7 +44,7 @@ public function configure(DefinitionConfigurator $definition): void /** * @param array{ * root_namespace: string, - * preset_types: array{scan_dirs: array}, + * custom_types: array{scan_dirs: array}, * custom_mappings: array{scan_dirs: array}, * carbon_mappings: array{enabled: boolean, replace: boolean} * } $config @@ -55,7 +55,7 @@ public function loadExtension(array $config, ContainerConfigurator $container, C $container->parameters() ->set('headsnet_doctrine_tools.root_namespace', $config['root_namespace']) - ->set('headsnet_doctrine_tools.preset_types.scan_dirs', $config['preset_types']['scan_dirs']) + ->set('headsnet_doctrine_tools.custom_types.scan_dirs', $config['custom_types']['scan_dirs']) ->set('headsnet_doctrine_tools.custom_mappings.scan_dirs', $config['custom_mappings']['scan_dirs']) ->set('headsnet_doctrine_tools.carbon_mappings.enabled', $config['carbon_mappings']['enabled']) ->set('headsnet_doctrine_tools.carbon_mappings.replace', $config['carbon_mappings']['replace']) diff --git a/src/Types/DoctrineTypesCompilerPass.php b/src/Types/DoctrineTypesCompilerPass.php index 8231419..76f3ea7 100644 --- a/src/Types/DoctrineTypesCompilerPass.php +++ b/src/Types/DoctrineTypesCompilerPass.php @@ -28,7 +28,7 @@ public function process(ContainerBuilder $container): void /** @var array $typeDefinitions */ $typeDefinitions = $container->getParameter(self::TYPE_DEFINITION_PARAMETER); /** @var array $scanDirs */ - $scanDirs = $container->getParameter('headsnet_doctrine_tools.preset_types.scan_dirs'); + $scanDirs = $container->getParameter('headsnet_doctrine_tools.custom_types.scan_dirs'); $this->rootNamespace = $container->getParameter('headsnet_doctrine_tools.root_namespace'); // @phpstan-ignore-line $objectsToRegister = $this->findObjectsToRegister($scanDirs);