Conditions | 3 |
Paths | 4 |
Total Lines | 29 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3.009 |
Changes | 0 |
1 | <?php |
||
22 | 1 | public function getConfigTreeBuilder() |
|
23 | { |
||
24 | 1 | $tree_builder = new TreeBuilder('gpslab_pagination'); |
|
25 | |||
26 | 1 | if (method_exists($tree_builder, 'getRootNode')) { |
|
27 | // Symfony 4.2 + |
||
28 | 1 | $root = $tree_builder->getRootNode(); |
|
29 | } else { |
||
30 | // Symfony 4.1 and below |
||
31 | $root = $tree_builder->root('gpslab_pagination'); |
||
|
|||
32 | } |
||
33 | |||
34 | // @codeCoverageIgnoreStart |
||
35 | if (!$root instanceof ArrayNodeDefinition) { |
||
36 | throw new \RuntimeException(sprintf( |
||
37 | 'Config root node must be a "%s", given "%s".', |
||
38 | 'Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition', |
||
39 | get_class($root) |
||
40 | )); |
||
41 | } |
||
42 | // @codeCoverageIgnoreEnd |
||
43 | |||
44 | 1 | $root->addDefaultsIfNotSet(); |
|
45 | 1 | $root->children()->scalarNode('max_navigate')->defaultValue(5); |
|
46 | 1 | $root->children()->scalarNode('parameter_name')->defaultValue('page'); |
|
47 | 1 | $root->children()->scalarNode('template')->defaultValue('GpsLabPaginationBundle::pagination.html.twig'); |
|
48 | |||
49 | 1 | return $tree_builder; |
|
50 | } |
||
51 | } |
||
52 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.