Completed
Push — master ( 46bde7...80fa66 )
by Peter
14:45 queued 13:00
created

Configuration   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 89.47%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 34
ccs 17
cts 19
cp 0.8947
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 28 2
1
<?php
2
3
/**
4
 * GpsLab component.
5
 *
6
 * @author    Peter Gribanov <[email protected]>
7
 * @copyright Copyright (c) 2011, Peter Gribanov
8
 * @license   http://opensource.org/licenses/MIT
9
 */
10
11
namespace GpsLab\Bundle\PaginationBundle\DependencyInjection;
12
13
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
14
use Symfony\Component\Config\Definition\ConfigurationInterface;
15
16
class Configuration implements ConfigurationInterface
17
{
18
    /**
19
     * @return TreeBuilder
20
     */
21 1
    public function getConfigTreeBuilder()
22
    {
23 1
        $tree_builder = new TreeBuilder('gpslab_pagination');
24
25 1
        if (method_exists($tree_builder, 'getRootNode')) {
26
            // Symfony 4.2 +
27
            $root = $tree_builder->getRootNode();
28
        } else {
29
            // Symfony 4.1 and below
30 1
            $root = $tree_builder->root('gpslab_pagination');
0 ignored issues
show
Deprecated Code introduced by
The method Symfony\Component\Config...der\TreeBuilder::root() has been deprecated with message: since Symfony 4.3, pass the root name to the constructor instead

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.

Loading history...
31
        }
32
33
        $root
34 1
            ->addDefaultsIfNotSet()
35 1
            ->children()
36 1
                ->scalarNode('max_navigate')
37 1
                    ->defaultValue(5)
38 1
                ->end()
39 1
                ->scalarNode('parameter_name')
40 1
                    ->defaultValue('page')
41 1
                ->end()
42 1
                ->scalarNode('template')
43 1
                    ->defaultValue('GpsLabPaginationBundle::pagination.html.twig')
44 1
                ->end()
45 1
            ->end();
46
47 1
        return $tree_builder;
48
    }
49
}
50