Configuration   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 25
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 11 1
A registerNormalizers() 0 10 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Paysera\Bundle\NormalizationBundle\DependencyInjection;
5
6
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
7
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
8
use Symfony\Component\Config\Definition\ConfigurationInterface;
9
10
class Configuration implements ConfigurationInterface
11
{
12 6
    public function getConfigTreeBuilder()
13
    {
14 6
        $treeBuilder = new TreeBuilder();
15 6
        $rootNode = $treeBuilder->root('paysera_normalization');
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...
16
17 6
        $children = $rootNode->children();
18
19 6
        $this->registerNormalizers($children->arrayNode('register_normalizers'));
20
21 6
        return $treeBuilder;
22
    }
23
24 6
    private function registerNormalizers(ArrayNodeDefinition $node)
25
    {
26 6
        $builder = $node->children();
27
        $builder
28 6
            ->arrayNode('date_time')
29 6
            ->children()
30 6
            ->scalarNode('format')
31 6
            ->isRequired()
32
        ;
33 6
    }
34
}
35