Configuration   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 32
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 26 2
1
<?php
2
3
namespace Freshcells\SoapClientBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * This is the class that validates and merges configuration from your app/config files
10
 *
11
 * To learn more see
12
 * {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
13
 */
14
class Configuration implements ConfigurationInterface
15
{
16
    /**
17
     * {@inheritDoc}
18
     */
19 3
    public function getConfigTreeBuilder()
20
    {
21 3
        $treeBuilder = new TreeBuilder('freshcells_soap_client');
22 3
        if (method_exists($treeBuilder, 'getRootNode')) {
23 1
            $rootNode = $treeBuilder->getRootNode();
24
        } else {
25
            // BC layer for symfony/config < 4.2
26 2
            $rootNode = $treeBuilder->root('freshcells_soap_client');
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...
27
        }
28
29 3
        $rootNode->children()
30 3
                    ->scalarNode('logger')->defaultFalse()->end()
31 3
                    ->arrayNode('anonymize_logs')
32
                    ->children()
33 3
                            ->arrayNode('elements')
34
                                ->scalarPrototype()->end()
35
                            ->end()
36
                            ->arrayNode('attributes')
37
                                ->scalarPrototype()->end()
38
                            ->end()
39
                    ->end()
40
                    ->end()
41
                    ->scalarNode('enable_profiler')->defaultTrue()->end();
42
43
        return $treeBuilder;
44
    }
45
}
46