Completed
Pull Request — master (#1)
by Sascha-Oliver
07:20 queued 05:24
created

Configuration::getConfigTreeBuilder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 0
cts 11
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 9
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Translation\PlatformAdapter\PhraseApp\Bridge\Symfony\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
class Configuration implements ConfigurationInterface
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function getConfigTreeBuilder()
14
    {
15
        $treeBuilder = new TreeBuilder();
16
        $root = $treeBuilder->root('translation_adapter_phrase_app');
17
18
        $root->children()
19
            ->scalarNode('project_id')->cannotBeEmpty()->end()
20
            ->scalarNode('token')->cannotBeEmpty()->end()
21
            ->arrayNode('locale_to_id_mapping')->prototype('scalar')->end()->end()
22
        ->end();
23
24
        return $treeBuilder;
25
    }
26
}
27