Configuration   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 22
ccs 0
cts 17
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 19 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Happyr\AnnotationWarmer\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
    public function getConfigTreeBuilder(): TreeBuilder
13
    {
14
        $treeBuilder = new TreeBuilder('happyr_annotation_warmer');
15
        if (\method_exists(TreeBuilder::class, 'getRootNode')) {
16
            $rootNode = $treeBuilder->getRootNode();
17
        } else {
18
            $rootNode = $treeBuilder->root('happyr_annotation_warmer');
0 ignored issues
show
Bug introduced by
The method root() does not seem to exist on object<Symfony\Component...on\Builder\TreeBuilder>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
19
        }
20
21
        $rootNode
22
            ->children()
23
                ->arrayNode('paths')->info('Paths to where we should look for annotations')
24
                    ->prototype('scalar')->end()
25
                ->end()
26
            ->end()
27
        ;
28
29
        return $treeBuilder;
30
    }
31
}
32