Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 13
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 17
ccs 13
cts 13
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 13
nc 1
nop 0
crap 1
1
<?php
2
3
/*
4
 * This file is part of the PHP Translation package.
5
 *
6
 * (c) PHP Translation team <[email protected]>
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 Translation\PlatformAdapter\Flysystem\Bridge\Symfony\DependencyInjection;
13
14
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
15
use Symfony\Component\Config\Definition\ConfigurationInterface;
16
17
/**
18
 * @author Tobias Nyholm <[email protected]>
19
 */
20
class Configuration implements ConfigurationInterface
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25 1
    public function getConfigTreeBuilder()
26
    {
27 1
        $treeBuilder = new TreeBuilder();
28 1
        $root = $treeBuilder->root('translation_adapter_flysystem');
29
30 1
        $root->children()
31 1
            ->arrayNode('filesystems')
32 1
            ->useAttributeAsKey('name')
33 1
            ->prototype('array')
34 1
            ->children()
35 1
                ->scalarNode('flysystem_service')->isRequired()->end()
36 1
                ->scalarNode('path')->isRequired()->end()
37 1
            ->end()
38 1
        ->end();
39
40 1
        return $treeBuilder;
41
    }
42
}
43