Passed
Push — master ( 9d720b...f70133 )
by Joel
03:04
created

Configuration::getConfigTreeBuilder()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 27
Code Lines 22

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 22
nc 1
nop 0
dl 0
loc 27
rs 8.8571
c 0
b 0
f 0
1
<?php
2
3
namespace RedirectionIO\Client\ProxySymfony\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
0 ignored issues
show
Bug introduced by Quentin Brunet
The type Symfony\Component\Config...ion\Builder\TreeBuilder was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
0 ignored issues
show
Bug introduced by Quentin Brunet
The type Symfony\Component\Config...\ConfigurationInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
8
class Configuration implements ConfigurationInterface
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function getConfigTreeBuilder()
14
    {
15
        $treeBuilder = new TreeBuilder();
16
        $rootNode = $treeBuilder->root('redirection_io');
17
18
        $rootNode
19
            ->children()
20
                ->arrayNode('connections')
21
                    ->normalizeKeys(false)
22
                    ->useAttributeAsKey('name')
23
                    ->addDefaultChildrenIfNoneSet('default')
24
                    ->prototype('scalar')
25
                        ->info('a TCP or unix socket')
26
                        ->example('tcp://127.0.0.1:20301 or unix:///var/run/redirectionio_agent.sock')
27
                        ->isRequired()
28
                        ->cannotBeEmpty()
29
                        ->defaultValue('tcp://127.0.0.1:20301')
30
                    ->end()
31
                ->end()
32
                ->booleanNode('debug')
33
                    ->info('Throw exception if something wrong happens')
34
                    ->defaultValue('%kernel.debug%')
35
                ->end()
36
            ->end()
37
        ;
38
39
        return $treeBuilder;
40
    }
41
}
42