ongr-io / ElasticsearchBundle

Symfony bundle for Elasticsearch with steroids
MIT License
313 stars 189 forks source link

Deprecation warning for symfony version >=4.3 #908

Closed PWalkow closed 4 years ago

PWalkow commented 4 years ago

A tree builder without a root node is deprecated since Symfony 4.2 and will not be supported anymore in 5.0.

bundle version: 5 symfony version: 4.4

example of fix in doctrine-bundle:

$treeBuilder = new TreeBuilder('doctrine');

if (method_exists($treeBuilder, 'getRootNode')) {
    $rootNode = $treeBuilder->getRootNode();
} else {
    // BC layer for symfony/config 4.1 and older
   $rootNode = $treeBuilder->root('doctrine');
}
saimaz commented 4 years ago

Fixed in v6 and v7