Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 26
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 23 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Maba\Bundle\RestBundle\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 81
    public function getConfigTreeBuilder()
13
    {
14 81
        $treeBuilder = new TreeBuilder();
15 81
        $rootNode = $treeBuilder->root('maba_paysera_rest');
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 81
        $children = $rootNode->children();
18 81
        $children->arrayNode('locales')->defaultValue([])->prototype('scalar');
19
20
        /** @var ArrayNodeDefinition $findDenormalizersNode */
21
        $findDenormalizersNode = $children
22 81
            ->arrayNode('path_attribute_resolvers')
23 81
            ->defaultValue([])
24 81
            ->useAttributeAsKey('class')
25 81
            ->prototype('array')
26
        ;
27 81
        $denormalizerPrototype = $findDenormalizersNode->children();
28 81
        $denormalizerPrototype->scalarNode('field')->defaultValue('id');
29
30 81
        $validationNode = $children->arrayNode('validation')->addDefaultsIfNotSet()->children();
31 81
        $validationNode->scalarNode('property_path_converter')->defaultNull();
32
33 81
        return $treeBuilder;
34
    }
35
}
36