Skip to content

Commit

Permalink
Merge pull request #49 from acrobat/fix-sf-config-deprecation
Browse files Browse the repository at this point in the history
[CookieBundle] Fix symfony config rootNode deprecation
  • Loading branch information
acrobat authored Sep 4, 2020
2 parents cbe6bd1 + 1c20c92 commit 982c51b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('kunstmaan_cookie');
$treeBuilder = new TreeBuilder('kunstmaan_cookie');
if (method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$rootNode = $treeBuilder->root('kunstmaan_cookie');
}

// Here you should define the parameters that are allowed to
// configure your bundle. See the documentation linked above for
Expand Down

0 comments on commit 982c51b

Please sign in to comment.