Skip to content

Commit ce52289

Browse files
Symfony 5.0 Update
A tree builder without a root node is deprecated since Symfony 4.2 and will not be supported anymore in 5.0
1 parent a84adfb commit ce52289

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

DependencyInjection/Configuration.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,14 @@ class Configuration implements ConfigurationInterface
1212
*/
1313
public function getConfigTreeBuilder()
1414
{
15+
1516
$tb = new TreeBuilder('enqueue_elastica');
16-
$rootNode = $tb->getRootNode();
17+
if (method_exists($tb, 'getRootNode')) {
18+
$rootNode = $tb->getRootNode();
19+
} else {
20+
// BC layer for symfony/config 4.1 and older
21+
$rootNode = $tb->root('enqueue_elastica');
22+
}
1723
$rootNode
1824
->children()
1925
->booleanNode('enabled')->defaultValue(true)->end()

0 commit comments

Comments
 (0)