Configuration   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 94.74%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 28 2
1
<?php
2
3
namespace SymfonyBundles\JsonRequestBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
use SymfonyBundles\JsonRequestBundle\EventListener\RequestTransformerListener;
8
9
class Configuration implements ConfigurationInterface
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14 2
    public function getConfigTreeBuilder()
15
    {
16 2
        $builder = new TreeBuilder('sb_json_request');
17
18 2
        if (\method_exists($builder, 'getRootNode')) {
19 2
            $rootNode = $builder->getRootNode();
20
        } else {
21
            // BC layer for symfony/config 4.1 and older
22
            $rootNode = $builder->root('maker');
0 ignored issues
show
Bug introduced by
The method root() does not seem to exist on object<Symfony\Component...on\Builder\TreeBuilder>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
23
        }
24
25
        $rootNode
26 2
            ->children()
27 2
                ->arrayNode('listener')
28 2
                    ->addDefaultsIfNotSet()
29 2
                    ->children()
30 2
                        ->scalarNode('request_transformer')
31 2
                            ->defaultValue(RequestTransformerListener::class)
32 2
                        ->end()
33 2
                        ->scalarNode('priority')
34 2
                            ->defaultValue(100)
35 2
                        ->end()
36 2
                    ->end()
37 2
                ->end()
38 2
            ->end();
39
40 2
        return $builder;
41
    }
42
}
43