Skip to content

Commit

Permalink
change test code in Configuration class
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-gribanov committed Aug 14, 2019
1 parent d7d9197 commit b349796
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
if (method_exists('Symfony\Component\Config\Definition\Builder\TreeBuilder', 'getRootNode')) { // Symfony >4.2
$builder = new TreeBuilder('gpslab_pagination');
$root = $builder->getRootNode();
$tree_builder = new TreeBuilder('gpslab_pagination');

if (method_exists($tree_builder, 'getRootNode')) {
// Symfony 4.2 +
$root = $tree_builder->getRootNode();
} else {
$builder = new TreeBuilder();
$root = $builder->root('gpslab_pagination');
// Symfony 4.1 and below
$root = $tree_builder->root('gpslab_pagination');
}

$root
Expand All @@ -41,6 +43,6 @@ public function getConfigTreeBuilder()
->end()
->end();

return $builder;
return $tree_builder;
}
}

0 comments on commit b349796

Please sign in to comment.