Skip to content

Commit

Permalink
Fix deprecation for symfony/config 4.2 (#69)
Browse files Browse the repository at this point in the history
* Fix deprecation for symfony/config 4.2

Fixed the same way as in sensiolabs/SensioFrameworkExtraBundle@be6a8cc

* fix variable name
  • Loading branch information
fmonts authored and dmaicher committed Dec 9, 2018
1 parent 8e36e8d commit f166fed
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$root = $treeBuilder->root('dama_doctrine_test');
$treeBuilder = new TreeBuilder('dama_doctrine_test');

if (method_exists($treeBuilder, 'getRootNode')) {
$root = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$root = $treeBuilder->root('dama_doctrine_test');
}

$root
->addDefaultsIfNotSet()
Expand Down

0 comments on commit f166fed

Please sign in to comment.