Skip to content

Commit

Permalink
Fix deprecation in SF 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
TorbenLundsgaard committed Dec 3, 2018
1 parent 5bbf023 commit f0fd680
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,21 @@ final class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('tla_grabzit');

$treeBuilder = new TreeBuilder('tla_grabzit');

if (method_exists($treeBuilder,'getRootNode')) {
$rootNode = $treeBuilder->getRootNode();
} else {
$rootNode = $treeBuilder->root('tla_grabzit');
}

$rootNode
->children()
->scalarNode('key')->defaultNull()->end()
->scalarNode('secret')->defaultNull()->end()
->end()
;

return $treeBuilder;
}
}

0 comments on commit f0fd680

Please sign in to comment.