Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 18
CRAP Score 1

Importance

Changes 9
Bugs 0 Features 1
Metric Value
c 9
b 0
f 1
dl 0
loc 22
ccs 18
cts 18
cp 1
rs 9.2
cc 1
eloc 18
nc 1
nop 0
crap 1
1
<?php
2
3
namespace AerialShip\SamlSPBundle\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
     * Generates the configuration tree builder.
12
     *
13
     * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder
14
     */
15 9
    public function getConfigTreeBuilder()
16
    {
17 9
        $treeBuilder = new TreeBuilder();
18 9
        $root = $treeBuilder->root('aerial_ship_saml_sp');
19
20 9
        $root->children()
21 9
            ->enumNode('driver')
22 9
                ->values(array('orm', 'mongodb'))
23 9
                ->cannotBeEmpty()
24 9
                ->defaultValue('orm')
25 9
                ->end()
26 9
            ->scalarNode('sso_state_entity_class')
27 9
                ->isRequired()
28 9
                ->cannotBeEmpty()
29 9
            ->end()
30 9
            ->scalarNode('model_manager_name')
31 9
                ->defaultNull()
32 9
            ->end()
33 9
        ->end();
34
35 9
        return $treeBuilder;
36
    }
37
}
38