Configuration   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 96.3%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 43
ccs 26
cts 27
cp 0.963
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 35 2
1
<?php
2
3
namespace Kunstmaan\MediaBundle\DependencyInjection;
4
5
use Kunstmaan\MediaBundle\Utils\SymfonyVersion;
6
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
7
use Symfony\Component\Config\Definition\ConfigurationInterface;
8
9
/**
10
 * This is the class that validates and merges configuration from your app/config files
11
 *
12
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
13
 */
14
class Configuration implements ConfigurationInterface
15
{
16
    /**
17
     * Generates the configuration tree.
18
     *
19
     * @return TreeBuilder
20
     */
21 6
    public function getConfigTreeBuilder()
22
    {
23 6
        $treeBuilder = new TreeBuilder('kunstmaan_media');
24 6
        if (method_exists($treeBuilder, 'getRootNode')) {
25 6
            $rootNode = $treeBuilder->getRootNode();
26
        } else {
27
            // BC layer for symfony/config 4.1 and older
28
            $rootNode = $treeBuilder->root('kunstmaan_media');
0 ignored issues
show
Deprecated Code introduced by
The method Symfony\Component\Config...der\TreeBuilder::root() has been deprecated with message: since Symfony 4.3, pass the root name to the constructor instead

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
29
        }
30
31
        $rootNode
32 6
            ->children()
33 6
                ->scalarNode('soundcloud_api_key')->defaultValue('YOUR_CLIENT_ID')->end()
34 6
                ->scalarNode('aviary_api_key')->setDeprecated('The child node "%node%" at path "%path%" is deprecated. Because the aviary service is discontinued.')->defaultNull()->end()
35 6
                ->arrayNode('remote_video')
36 6
                    ->addDefaultsIfNotSet()
37 6
                    ->children()
38 6
                        ->booleanNode('vimeo')->defaultTrue()->end()
39 6
                        ->booleanNode('youtube')->defaultTrue()->end()
40 6
                        ->booleanNode('dailymotion')->defaultTrue()->end()
41 6
                    ->end()
42 6
                ->end()
43 6
                ->booleanNode('enable_pdf_preview')->defaultFalse()->end()
44 6
                ->arrayNode('blacklisted_extensions')
45 6
                    ->defaultValue(array('php', 'htaccess'))
46 6
                    ->prototype('scalar')->end()
47 6
                ->end()
48 6
                ->scalarNode('web_root')
49 6
                    ->defaultValue(SymfonyVersion::getRootWebPath())
50 6
                    ->cannotBeEmpty()
51 6
                ->end()
52 6
            ->end();
53
54 6
        return $treeBuilder;
55
    }
56
}
57