Skip to content

Commit

Permalink
bug #1314 [TwigComponent] Allow Bundle configuration with PHP ConfigB…
Browse files Browse the repository at this point in the history
…uilder (smnandre)

This PR was merged into the 2.x branch.

Discussion
----------

[TwigComponent] Allow Bundle configuration with PHP ConfigBuilder

| Q             | A
| ------------- | ---
| Bug fix?      | yes/no
| New feature?  | yes/no
| Issues        | Fix #1304
| License       | MIT

Allow TwigComponent configuration via configbuilder.

Commits
-------

71d09ad [TwigComponent] Allow Bundle configuration with PHP ConfigBuilder
  • Loading branch information
kbond committed Dec 8, 2023
2 parents 4e0b7ad + 71d09ad commit bb32456
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
Expand Down Expand Up @@ -188,4 +189,9 @@ public function getConfigTreeBuilder(): TreeBuilder

return $treeBuilder;
}

public function getConfiguration(array $config, ContainerBuilder $container): ConfigurationInterface
{
return $this;
}
}

0 comments on commit bb32456

Please sign in to comment.