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

Configuration::getConfigTreeBuilder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
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 16
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
        $rootNode = $treeBuilder->root(JsonRpcHttpServerExtension::EXTENSION_IDENTIFIER);
15
16
        $rootNode
17
            ->addDefaultsIfNotSet()
1 ignored issue
show
Bug introduced by
The method addDefaultsIfNotSet() does not exist on Symfony\Component\Config...\Builder\NodeDefinition. It seems like you code against a sub-type of Symfony\Component\Config...\Builder\NodeDefinition such as Symfony\Component\Config...der\ArrayNodeDefinition. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

17
            ->/** @scrutinizer ignore-call */ 
18
              addDefaultsIfNotSet()
Loading history...
18
            ->children()
19
                ->variableNode('method_resolver')
20
                    ->info('Your custom method resolver service')
21
                    ->treatNullLike(false)
22
                ->end()
23
            ->end()
24
        ;
25
26
        return $treeBuilder;
27
    }
28
}
29