From 71d09ad276943e0b1649f7b2cec2c2c07b0ff588 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Andr=C3=A9?= Date: Wed, 29 Nov 2023 21:46:41 +0100 Subject: [PATCH] [TwigComponent] Allow Bundle configuration with PHP ConfigBuilder --- .../src/DependencyInjection/TwigComponentExtension.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/TwigComponent/src/DependencyInjection/TwigComponentExtension.php b/src/TwigComponent/src/DependencyInjection/TwigComponentExtension.php index 68b4e7d4114..f236bb72033 100644 --- a/src/TwigComponent/src/DependencyInjection/TwigComponentExtension.php +++ b/src/TwigComponent/src/DependencyInjection/TwigComponentExtension.php @@ -53,7 +53,8 @@ public function load(array $configs, ContainerBuilder $container): void throw new LogicException('The TwigBundle is not registered in your application. Try running "composer require symfony/twig-bundle".'); } - $config = $this->processConfiguration($this, $configs); + $configuration = $this->getConfiguration($configs, $container); + $config = $this->processConfiguration($configuration, $configs); $defaults = $config['defaults']; if ($defaults === [self::DEPRECATED_DEFAULT_KEY]) { trigger_deprecation('symfony/ux-twig-component', '2.13', 'Not setting the "twig_component.defaults" config option is deprecated. Check the documentation for an example configuration.'); @@ -188,4 +189,9 @@ public function getConfigTreeBuilder(): TreeBuilder return $treeBuilder; } + + public function getConfiguration(array $config, ContainerBuilder $container): ConfigurationInterface + { + return $this; + } }