Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
eloc 16
c 2
b 0
f 0
dl 0
loc 22
ccs 15
cts 15
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 20 1
1
<?php
2
/*
3
 * This file is part of Goodwix Doctrine JSON ODM.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace Goodwix\DoctrineJsonOdm\Bridge\Symfony\DependencyInjection;
10
11
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
12
use Symfony\Component\Config\Definition\ConfigurationInterface;
13
14
class Configuration implements ConfigurationInterface
15
{
16 5
    public function getConfigTreeBuilder(): TreeBuilder
17
    {
18 5
        $treeBuilder = new TreeBuilder('doctrine_json_odm');
19 5
        $rootNode = $treeBuilder->getRootNode();
20
21
        $rootNode
22 5
            ->children()
23 5
                ->arrayNode('mapping')
24 5
                ->isRequired()
25 5
                ->children()
26 5
                    ->arrayNode('paths')
27 5
                        ->isRequired()
28 5
                        ->requiresAtLeastOneElement()
29 5
                        ->prototype('scalar')->end()
30 5
                    ->end()
31 5
                ->end()
32 5
            ->end()
33
        ;
34
35 5
        return $treeBuilder;
36
    }
37
}
38