Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 16
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 19
rs 9.7333
1
<?php
2
3
namespace NW\JsonRequestBundle\DependencyInjection;
4
5
use NW\JsonRequestBundle\EventListener\RequestTransformerListener;
6
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
7
use Symfony\Component\Config\Definition\ConfigurationInterface;
8
9
class Configuration implements ConfigurationInterface
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14
    public function getConfigTreeBuilder()
15
    {
16
        $builder = new TreeBuilder('nw_json_request');
17
        $builder->getRootNode()
18
            ->children()
19
                ->arrayNode('listener')
20
                    ->addDefaultsIfNotSet()
21
                    ->children()
22
                        ->scalarNode('request_transformer')
23
                            ->defaultValue(RequestTransformerListener::class)
24
                        ->end()
25
                        ->scalarNode('priority')
26
                            ->defaultValue(100)
27
                        ->end()
28
                    ->end()
29
                ->end()
30
            ->end();
31
32
        return $builder;
33
    }
34
}
35