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

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 20
ccs 0
cts 14
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 16 1
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