Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 57
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 51 1
1
<?php
2
3
namespace Partnermarketing\FileSystemBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * This is the class that validates and merges configuration from your app/config files
10
 *
11
 * To learn more see:
12
 * @link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class
13
 */
14
class Configuration implements ConfigurationInterface
15
{
16
    /**
17
     * {@inheritDoc}
18
     */
19
    public function getConfigTreeBuilder()
20
    {
21
        $treeBuilder = new TreeBuilder();
22
        $rootNode = $treeBuilder->root('partnermarketing_file_system');
23
24
        $rootNode
25
            ->children()
26
                ->scalarNode('default_file_system')
27
                    ->isRequired()
28
                ->end()
29
                ->scalarNode('tmp_dir')
30
                    ->defaultValue('/tmp')
31
                ->end()
32
                ->arrayNode('config')
33
                    ->addDefaultsIfNotSet()
34
                    ->children()
35
                        ->arrayNode('amazon_s3')
36
                            ->children()
37
                                ->scalarNode('key')
38
                                    ->defaultValue('~')
39
                                ->end()
40
                                ->scalarNode('secret')
41
                                    ->defaultValue('~')
42
                                ->end()
43
                                ->scalarNode('bucket')
44
                                    ->defaultValue('~')
45
                                ->end()
46
                                ->scalarNode('region')
47
                                    ->defaultValue('~')
48
                                ->end()
49
                                ->scalarNode('acl')
50
                                    ->defaultValue('public-read')
51
                                ->end()
52
                            ->end()
53
                        ->end()
54
                        ->arrayNode('local_storage')
55
                            ->children()
56
                                ->scalarNode('path')
57
                                    ->isRequired()
58
                                ->end()
59
                                ->scalarNode('url')
60
                                    ->isRequired()
61
                                ->end()
62
                            ->end()
63
                        ->end()
64
                    ->end()
65
                ->end()
66
            ->end();
67
68
        return $treeBuilder;
69
    }
70
}
71