Skip to content

Commit

Permalink
Add compatibility for symfony/config 3.4
Browse files Browse the repository at this point in the history
by fixing
Error: Call to undefined method Symfony\Component\Config\Definition\Builder\TreeBuilder::getRootNode()
  • Loading branch information
robertfausk committed Mar 29, 2020
1 parent ea2999a commit 14f9d9e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ServiceContainer/PantherConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ public function addOptionsNode(): ArrayNodeDefinition
{
$treeBuilder = new TreeBuilder('options');

$node = $treeBuilder->getRootNode()
if (\method_exists($treeBuilder, 'getRootNode')) {
$root = $treeBuilder->getRootNode();
} else {
$root = $treeBuilder->root('options');
}

$node = $root
->info(
"These are the options passed as first argument to PantherTestCaseTrait::createPantherClient client constructor."
)
Expand Down

0 comments on commit 14f9d9e

Please sign in to comment.