Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 15
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 15
c 2
b 0
f 0
dl 0
loc 20
ccs 15
cts 15
cp 1
rs 9.7666
cc 1
nc 1
nop 0
crap 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