Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 65
ccs 42
cts 42
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 49 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MovingImage\Bundle\VMProApiBundle\DependencyInjection;
6
7
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
8
use Symfony\Component\Config\Definition\ConfigurationInterface;
9
10
class Configuration implements ConfigurationInterface
11
{
12
    /**
13
     * @const Which API base URL to use by default.
14
     */
15
    private const DEFAULT_API_BASE_URL = 'https://api.video-cdn.net/v1/vms/';
16
17
    /**
18
     * @const Default OAuth URL (used for fetching and refreshing access token)
19
     */
20
    private const DEFAULT_OAUTH_URL = 'https://login.movingimage.com/auth/realms/platform/protocol/openid-connect/token';
21
22
    /**
23
     * Build the configuration structure for this bundle.
24
     */
25
    public function getConfigTreeBuilder(): TreeBuilder
26
    {
27
        $treeBuilder = new TreeBuilder();
28
        $rootNode = $treeBuilder->root('vm_pro_api');
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 12
        $rootNode
31
            ->children()
32 12
                ->scalarNode('base_url')
33 12
                    ->defaultValue(self::DEFAULT_API_BASE_URL)
34
                ->end()
35
                ->scalarNode('oauth_url')
36 12
                    ->defaultValue(self::DEFAULT_OAUTH_URL)
37 12
                ->end()
38 12
                ->scalarNode('default_vm_id')
39 12
                    ->defaultValue(0)
40 12
                ->end()
41 12
                ->arrayNode('credentials')
42 12
                    ->isRequired()
43 12
                    ->children()
44 12
                        ->scalarNode('username')->isRequired()->end()
45 12
                        ->scalarNode('password')->isRequired()->end()
46 12
                    ->end()
47 12
                ->end()
48 12
                ->arrayNode('rating_meta_data_fields')
49 12
                    ->children()
50 12
                        ->scalarNode('average')->isRequired()->end()
51 12
                        ->scalarNode('count')->isRequired()->end()
52 12
                    ->end()
53 12
                ->end()
54 12
                ->scalarNode('logger')
55 12
                    ->defaultValue(null)
56 12
                ->end()
57 12
                ->scalarNode('cache_pool')
58 12
                    ->defaultValue(null)
59 12
                ->end()
60 12
                ->scalarNode('cache_ttl')
61 12
                    ->defaultValue(null)
62 12
                ->end()
63 12
                ->scalarNode('cache_bypass_argument')
64 12
                    ->defaultValue(null)
65 12
                ->end()
66 12
                ->booleanNode('enable_stopwatch')
67 12
                    ->defaultValue(false)
68 12
                ->end()
69 12
            ->end()
70 12
        ;
71 12
72 12
        return $treeBuilder;
73 12
    }
74
}
75