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

Configuration::getConfigTreeBuilder()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 29
Code Lines 24

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 23
CRAP Score 1

Importance

Changes 3
Bugs 1 Features 1
Metric Value
c 3
b 1
f 1
dl 0
loc 29
ccs 23
cts 23
cp 1
rs 8.8571
cc 1
eloc 24
nc 1
nop 0
crap 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