Failed Conditions
Pull Request — master (#5)
by Yo
01:55
created

Configuration::getConfigTreeBuilder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 11
nc 1
nop 0
dl 0
loc 17
ccs 0
cts 14
cp 0
crap 2
rs 9.4285
c 0
b 0
f 0
1
<?php
2
namespace Yoanm\SymfonyJsonRpcHttpServer\Infra\Symfony\DependencyInjection;
3
4
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
5
use Symfony\Component\Config\Definition\ConfigurationInterface;
6
7
class Configuration implements ConfigurationInterface
8
{
9
    const DEFAULT_JSONRPC_ENDPOINT = '/json-rpc';
10
11
    public function getConfigTreeBuilder()
12
    {
13
        $treeBuilder = new TreeBuilder();
14
15
        $rootNode = $treeBuilder->root(JsonRpcHttpServerExtension::EXTENSION_IDENTIFIER);
16
17
        $rootNode
18
            ->children()
19
                ->variableNode('method_resolver')
20
                    ->info('Your custom method resolver service')
21
                    ->treatNullLike(false)
22
                    ->defaultFalse()
23
                ->end()
24
            ->end()
25
        ;
26
27
        return $treeBuilder;
28
    }
29
}
30