Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 14
c 1
b 0
f 0
dl 0
loc 24
ccs 14
cts 14
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 18 1
1
<?php
2
namespace Yoanm\SymfonyJsonRpcHttpServerDoc\DependencyInjection;
3
4
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
5
use Symfony\Component\Config\Definition\ConfigurationInterface;
6
7
/**
8
 * Class Configuration
9
 */
10
class Configuration implements ConfigurationInterface
11
{
12
    const DEFAULT_ENDPOINT = '/doc';
13
    /**
14
     * {@inheritdoc}
15
     */
16 4
    public function getConfigTreeBuilder()
17
    {
18 4
        $treeBuilder = new TreeBuilder(JsonRpcHttpServerDocExtension::EXTENSION_IDENTIFIER);
19
20 4
        $rootNode = $treeBuilder->getRootNode();
21
22 4
        $rootNode
23 4
            ->addDefaultsIfNotSet()
24 4
            ->children()
25 4
                ->variableNode('endpoint')
26 4
                    ->info('Your custom http doc endpoint path')
27 4
                    ->treatNullLike(self::DEFAULT_ENDPOINT)
28 4
                    ->defaultValue(self::DEFAULT_ENDPOINT)
29 4
                ->end()
30 4
            ->end()
31 4
        ;
32
33 4
        return $treeBuilder;
34
    }
35
}
36