Skip to content

Commit

Permalink
Merge pull request #2 from tobias-93/fix-dependency-injection-sf5
Browse files Browse the repository at this point in the history
Fix Dependency Injection for Symfony 5
  • Loading branch information
bobvandevijver authored Jul 7, 2021
2 parents 3e77ce6 + 7423e3b commit d7ad8d2
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,15 @@ class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$builder = new TreeBuilder();
$builder->root('bobv_entity_history')
$treeBuilder = new TreeBuilder('bobv_entity_history');

if (method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->getRootNode();
} else {
// for symfony/config 4.1 and older
$rootNode = $treeBuilder->root('bobv_entity_history');
}
$rootNode
->children()
->arrayNode('entities')
->prototype('scalar')->end()
Expand Down Expand Up @@ -53,6 +60,6 @@ public function getConfigTreeBuilder()
->end()
->end();

return $builder;
return $treeBuilder;
}
}

0 comments on commit d7ad8d2

Please sign in to comment.