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 0
CRAP Score 2

Importance

Changes 3
Bugs 0 Features 1
Metric Value
c 3
b 0
f 1
dl 0
loc 20
ccs 0
cts 18
cp 0
rs 9.4285
cc 1
eloc 15
nc 1
nop 0
crap 2
1
<?php
2
3
/*
4
 * This file is part of the ChrisyueAutoJsonResponseBundle package.
5
 *
6
 * (c) Chrisyue <http://chrisyue.com/>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Chrisyue\Bundle\AutoJsonResponseBundle\DependencyInjection;
13
14
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
15
use Symfony\Component\Config\Definition\ConfigurationInterface;
16
17
class Configuration implements ConfigurationInterface
18
{
19
    /**
20
     * {@inheritdoc}
21
     */
22
    public function getConfigTreeBuilder()
23
    {
24
        $treeBuilder = new TreeBuilder();
25
        $rootNode = $treeBuilder->root('chrisyue_auto_json_response');
26
27
        $rootNode
28
            ->children()
29
                ->arrayNode('serializer')
30
                    ->canBeEnabled()
31
                    ->children()
32
                        ->arrayNode('default_groups')
33
                            ->prototype('scalar')->end()
34
                        ->end()
35
                    ->end()
36
                ->end()
37
            ->end()
38
        ;
39
40
        return $treeBuilder;
41
    }
42
}
43