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 authored and jwage committed Jan 9, 2019
1 parent 0128299 commit 2a72bec
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions DependencyInjection/Configuration.php
Expand Up @@ -10,6 +10,7 @@
use function constant;
use function in_array;
use function is_string;
use function method_exists;
use function strlen;
use function strpos;
use function strtoupper;
Expand All @@ -27,8 +28,14 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder() : TreeBuilder
{
$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 2a72bec

Please sign in to comment.