Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 12
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 17
ccs 12
cts 12
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 13
nc 1
nop 0
crap 1
1
<?php
2
3
/*
4
 * This file is part of Sulu.
5
 *
6
 * (c) MASSIVE ART WebServices GmbH
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Sulu\Bundle\ValidationBundle\DependencyInjection;
13
14
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
15
use Symfony\Component\Config\Definition\ConfigurationInterface;
16
17
/**
18
 * Class that validates and merges configuration from your app/config files.
19
 */
20
class Configuration implements ConfigurationInterface
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25 1
    public function getConfigTreeBuilder()
26
    {
27 1
        $treeBuilder = new TreeBuilder();
28 1
        $rootNode = $treeBuilder->root('sulu_validation');
29
30
        $rootNode
31 1
            ->children()
32 1
                ->arrayNode('schemas')
33 1
                    ->prototype('scalar')->end()
34 1
                ->end()
35 1
                ->scalarNode('schema_cache')
36 1
                    ->defaultValue('%kernel.cache_dir%/schema/jsonSchemaCache.php')
37 1
                ->end()
38 1
            ->end();
39
40 1
        return $treeBuilder;
41
    }
42
}
43