Completed
Push — master ( a4551f...f2d5c9 )
by Paweł
19:10 queued 05:45
created

Configuration::getConfigTreeBuilder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 23
rs 9.0856
cc 1
eloc 18
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sylius\Bundle\AdminBundle\DependencyInjection;
13
14
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
15
use Symfony\Component\Config\Definition\ConfigurationInterface;
16
17
/**
18
 * @author Jan Góralski <[email protected]>
19
 */
20
final class Configuration implements ConfigurationInterface
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function getConfigTreeBuilder()
26
    {
27
        $treeBuilder = new TreeBuilder();
28
        $rootNode = $treeBuilder->root('sylius_admin');
29
30
        $rootNode
31
            ->children()
32
                ->arrayNode('notifications')
33
                    ->addDefaultsIfNotSet()
34
                    ->children()
35
                        ->booleanNode('enabled')
36
                            ->defaultTrue()
37
                        ->end()
38
                        ->integerNode('frequency')
39
                            ->defaultValue(60)
40
                        ->end()
41
                    ->end()
42
                ->end()
43
            ->end()
44
        ;
45
46
        return $treeBuilder;
47
    }
48
}
49