Skip to content

Commit

Permalink
Add bc layer for getting root node to configuration class (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-rath authored Aug 1, 2022
1 parent c4b6689 commit 24e9dc9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
9 changes: 7 additions & 2 deletions 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('massive_art_pdf');
$treeBuilder = new TreeBuilder('massive_pdf');
if (method_exists($treeBuilder, 'getRootNode')) {
$root = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$root = $treeBuilder->root('massive_pdf');
}

$rootNode
->children()
Expand Down
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
"require": {
"php": ">=5.4",
"knplabs/knp-snappy-bundle": "^1.4",
"twig/twig": "^1.0 || ^2.0 || ^3.0"
"twig/twig": "^1.0 || ^2.0 || ^3.0",
"symfony/http-kernel": "^3.4 || ^4.0 || ^5.0 || ^6.0",
"symfony/http-foundation": "^3.4 || ^4.0 || ^5.0 || ^6.0",
"symfony/config": "^3.4 || ^4.0 || ^5.0 || ^6.0",
"symfony/dependency-injection": "^3.4 || ^4.0 || ^5.0 || ^6.0",
"symfony/framework-bundle": "^3.4 || ^4.0 || ^5.0 || ^6.0"
},
"autoload": {
"psr-4": {
Expand Down

0 comments on commit 24e9dc9

Please sign in to comment.