Completed
Push — master ( 778961...e63dfa )
by Márk
05:24
created

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 1 Features 1
Metric Value
wmc 1
c 3
b 1
f 1
lcom 0
cbo 3
dl 0
loc 32
ccs 23
cts 23
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 29 1
1
<?php
2
3
namespace Indigo\Bundle\CookieConsentBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * @author Márk Sági-Kazár <[email protected]>
10
 */
11
class Configuration implements ConfigurationInterface
12
{
13 3
    public function getConfigTreeBuilder()
14
    {
15 3
        $treeBuilder = new TreeBuilder();
16 3
        $rootNode = $treeBuilder->root('indigo_cookie_consent');
17
18
        $rootNode
19 3
            ->children()
20 3
                ->arrayNode('options')
21 3
                    ->addDefaultsIfNotSet()
22 3
                    ->info('See valid options at https://silktide.com/tools/cookie-consent/docs/installation')
23 3
                    ->children()
24 3
                        ->scalarNode('link')->end()
25 3
                        ->scalarNode('container')->end()
26 3
                        ->scalarNode('theme')->end()
27 3
                        ->scalarNode('path')->end()
28 3
                        ->scalarNode('domain')->end()
29 3
                        ->integerNode('expiryDays')->end()
30 3
                        ->scalarNode('target')->end()
31 3
                    ->end()
32 3
                ->end()
33 3
                ->scalarNode('script')
34 3
                    ->defaultValue('//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/1.0.10/cookieconsent.min.js')
35 3
                    ->info('Set this to false to disable script (eg. when you compiled it into yours)')
36 3
                ->end()
37 3
            ->end()
38
        ;
39
40 3
        return $treeBuilder;
41
    }
42
}
43