Skip to content

Commit

Permalink
Merge pull request #112 from Cloudstek/fix-config-deprecation
Browse files Browse the repository at this point in the history
Fix root node deprecation in symfony/config > 4.1
  • Loading branch information
Seldaek committed Dec 11, 2018
2 parents ec61c1b + 001f2ec commit c8c1d99
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,14 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('nelmio_cors');
$treeBuilder = new TreeBuilder('nelmio_cors');

if (method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->getRootNode();
} else {
// BC for symfony/config < 4.2
$rootNode = $treeBuilder->root('nelmio_cors');
}

$rootNode
->children()
Expand Down

0 comments on commit c8c1d99

Please sign in to comment.