Skip to content

Commit

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

$root
->addDefaultsIfNotSet()
->children()
->scalarNode('max_navigate')
Expand Down

0 comments on commit d7d9197

Please sign in to comment.