Skip to content
Permalink
Browse files

Merge pull request #43 from killerwolf/fix-tree-builder-deprecation

Remove deprecated usage of tree builder where possible
  • Loading branch information...
lyrixx committed Apr 9, 2019
2 parents 81a3fca + 53023b2 commit 772fcde584ed14bd4feeeb06549402efc135d8ab
Showing with 11 additions and 2 deletions.
  1. +11 −2 src/JoliTypo/Bridge/Symfony/DependencyInjection/Configuration.php
@@ -19,8 +19,8 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('joli_typo');
$treeBuilder = new TreeBuilder('joli_typo');
$rootNode = $this->getRootNode($treeBuilder, 'joli_typo');
$rootNode
->fixXmlConfig('preset')
@@ -42,4 +42,13 @@ public function getConfigTreeBuilder()
return $treeBuilder;
}
private function getRootNode(TreeBuilder $treeBuilder, $name)
{
// BC layer for symfony/config 4.1 and older
if (! \method_exists($treeBuilder, 'getRootNode')) {
return $treeBuilder->root($name);
}
return $treeBuilder->getRootNode();
}
}

0 comments on commit 772fcde

Please sign in to comment.
You can’t perform that action at this time.