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

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 18 1
1
<?php
2
namespace Yoanm\SymfonyJsonRpcHttpServer\Infra\Symfony\DependencyInjection;
3
4
use Symfony\Component\Config\Definition\ArrayNode;
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
class Configuration implements ConfigurationInterface
9
{
10
    const DEFAULT_JSONRPC_ENDPOINT = '/json-rpc';
11
12
    public function getConfigTreeBuilder()
13
    {
14
        $treeBuilder = new TreeBuilder();
15
        /** @var ArrayNode $rootNode */
16
        $rootNode = $treeBuilder->root(JsonRpcHttpServerExtension::EXTENSION_IDENTIFIER, 'array');
17
18
        $rootNode
19
            ->addDefaultsIfNotSet()
0 ignored issues
show
Bug introduced by
The method addDefaultsIfNotSet() does not exist on Symfony\Component\Config\Definition\ArrayNode. ( Ignorable by Annotation )

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

19
            ->/** @scrutinizer ignore-call */ 
20
              addDefaultsIfNotSet()

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
20
            ->children()
21
                ->variableNode('method_resolver')
22
                    ->info('Your custom method resolver service')
23
                    ->treatNullLike(false)
24
                    ->defaultFalse()
25
                ->end()
26
            ->end()
27
        ;
28
29
        return $treeBuilder;
30
    }
31
}
32