Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 9.6
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * @link https://github.com/phpviet/symfony-number-to-words
4
 *
5
 * @copyright (c) PHP Viet
6
 * @license [MIT](https://opensource.org/licenses/MIT)
7
 */
8
9
namespace PHPViet\Symfony\NumberToWords\DependencyInjection;
10
11
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
12
use Symfony\Component\Config\Definition\ConfigurationInterface;
13
14
/**
15
 * @author Vuong Minh <[email protected]>
16
 * @since 1.0.0
17
 */
18
class Configuration implements ConfigurationInterface
19
{
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public function getConfigTreeBuilder(): TreeBuilder
24
    {
25
        $treeBuilder = new TreeBuilder('n2w');
26
        $rootNode = $treeBuilder->getRootNode();
27
        $rootNode
28
            ->children()
29
            ->arrayNode('defaults')
30
            ->useAttributeAsKey('name')
31
            ->prototype('variable')
32
            ->end()
33
            ->end()
34
            ->arrayNode('dictionaries')
35
            ->useAttributeAsKey('name')
36
            ->prototype('variable')
37
            ->end()
38
            ->end()
39
            ->end();
40
41
        return $treeBuilder;
42
    }
43
}
44