Skip to content

Commit

Permalink
Merge pull request #10 from addfs/patch-1
Browse files Browse the repository at this point in the history
fix deprecations for symfony >= 4.2
  • Loading branch information
addfs authored Mar 16, 2022
2 parents edef3d0 + c3d239d commit 56ee32f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('intaro_file_uploader');
$treeBuilder = new TreeBuilder('intaro_file_uploader');
if (\method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$rootNode = $treeBuilder->root('intaro_file_uploader');
}

$rootNode
->children()
->arrayNode('uploaders')
Expand Down Expand Up @@ -54,4 +60,4 @@ public function getConfigTreeBuilder()

return $treeBuilder;
}
}
}

0 comments on commit 56ee32f

Please sign in to comment.