Completed
Push — master ( 6a1443...a4bc0b )
by Alex
05:23 queued 03:19
created

Configuration::getConfigTreeBuilder()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 29
Code Lines 21

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 1 Features 1
Metric Value
c 3
b 1
f 1
dl 0
loc 29
rs 8.8571
cc 1
eloc 21
nc 1
nop 0
1
<?php
2
3
namespace Debril\RssAtomBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * This is the class that validates and merges configuration from your app/config files.
10
 *
11
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
12
 */
13
class Configuration implements ConfigurationInterface
14
{
15
    /**
16
     * {@inheritDoc}
17
     */
18
    public function getConfigTreeBuilder()
19
    {
20
        $treeBuilder = new TreeBuilder();
21
22
        $treeBuilder->root('debril_rss_atom')
23
                ->children()
24
                    ->booleanNode('private')
25
                        ->info('Change cache headers so the RSS feed is not cached by public caches (like reverse-proxies...).')
26
                        ->defaultValue(false)
27
                    ->end()
28
                    ->arrayNode('date_formats')
29
                        ->prototype('scalar')->end()
30
                    ->end()
31
                    ->enumNode('driver')
32
                        ->info('Driver to use to fetch RSS feed. Valid values are "curl" (default), "file", "guzzle", "service".')
33
                        ->values(array('curl', 'file', 'guzzle', 'service'))
34
                        ->defaultValue('curl')
35
                    ->end()
36
                    ->scalarNode('driver_service')
37
                        ->info('If driver is set to "csa-guzzle" or "service", the ID of the service to use')
38
                    ->end()
39
                ->end()
40
        ;
41
42
        // Here you should define the parameters that are allowed to
43
        // configure your bundle. See the documentation linked above for
44
        // more information on that topic.
45
        return $treeBuilder;
46
    }
47
}
48