Skip to content

Commit

Permalink
Merge pull request #245 from chalasr/sf-42-deprec
Browse files Browse the repository at this point in the history
Fix deprecation on symfony/config 4.2
  • Loading branch information
stof committed Dec 3, 2018
2 parents e6e352f + e16ce0c commit 49fa399
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions DependencyInjection/Configuration.php
Expand Up @@ -20,8 +20,14 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('doctrine_migrations', 'array');
$treeBuilder = new TreeBuilder('doctrine_migrations');

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

$organizeMigrationModes = $this->getOrganizeMigrationsModes();

Expand Down

0 comments on commit 49fa399

Please sign in to comment.