Test Failed
Pull Request — master (#3)
by
unknown
10:08
created

Configuration   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 25
ccs 0
cts 13
cp 0
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
    public function getConfigTreeBuilder()
13
    {
14
        $treeBuilder = new TreeBuilder();
0 ignored issues
show
Bug introduced by
The call to TreeBuilder::__construct() misses a required argument $name.

This check looks for function calls that miss required arguments.

Loading history...
15
        $rootNode = $treeBuilder->root('paysera_normalization');
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...
16
17
        $children = $rootNode->children();
18
19
        $this->registerNormalizers($children->arrayNode('register_normalizers'));
20
21
        return $treeBuilder;
22
    }
23
24
    private function registerNormalizers(ArrayNodeDefinition $node)
25
    {
26
        $builder = $node->children();
27
        $builder
28
            ->arrayNode('date_time')
29
            ->children()
30
            ->scalarNode('format')
31
            ->isRequired()
32
        ;
33
    }
34
}
35