Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 4
Bugs 1 Features 1
Metric Value
c 4
b 1
f 1
dl 0
loc 15
rs 9.4285
cc 1
eloc 11
nc 1
nop 0
1
<?php
2
namespace Vresh\TwilioBundle\DependencyInjection;
3
4
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
5
use Symfony\Component\Config\Definition\ConfigurationInterface;
6
7
/**
8
 * This file is part of the VreshTwilioBundle.
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 *
13
 * @author Fridolin Koch <[email protected]>
14
 */
15
class Configuration implements ConfigurationInterface
16
{
17
    /**
18
     * Generates the configuration tree.
19
     *
20
     * @return \Symfony\Component\Config\Definition\NodeInterface
21
     */
22
    public function getConfigTreeBuilder()
23
    {
24
        $treeBuilder = new TreeBuilder();
25
        $rootNode = $treeBuilder->root('twilio');
26
27
        $rootNode
28
            ->children()
29
            ->scalarNode('sid')->isRequired()->end()
30
            ->scalarNode('authToken')->isRequired()->end()
31
            ->scalarNode('version')->defaultValue('2010-04-01')->end()
32
            ->scalarNode('retryAttempts')->defaultValue(1)->end()
33
            ->end();
34
35
        return $treeBuilder;
36
    }
37
}
38