Passed
Push — master ( 96d9d3...930d7e )
by Theo
07:33 queued 12s
created

Configuration::getConfigTreeBuilder()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2.0185

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 2
eloc 6
c 3
b 0
f 0
nc 2
nop 0
dl 0
loc 11
ccs 5
cts 6
cp 0.8333
crap 2.0185
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace CalendarBundle\DependencyInjection;
6
7
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
8
use Symfony\Component\Config\Definition\ConfigurationInterface;
9
10
/**
11
 * This is the class that validates and merges configuration from your app/config files.
12
 *
13
 * To learn more see {@link https://symfony.com/doc/current/bundles/extension.html}
14
 */
15
class Configuration implements ConfigurationInterface
16
{
17
    /**
18
     * {@inheritdoc}
19
     */
20 1
    public function getConfigTreeBuilder(): TreeBuilder
21
    {
22 1
        $treeBuilder = new TreeBuilder('maker');
23 1
        if (method_exists($treeBuilder, 'getRootNode')) {
24 1
            $treeBuilder->getRootNode();
25
        } else {
26
            // BC layer for symfony/config 4.1 and older
27
            $treeBuilder->root('maker');
0 ignored issues
show
Deprecated Code introduced by
The function Symfony\Component\Config...der\TreeBuilder::root() has been deprecated: since Symfony 4.3, pass the root name to the constructor instead ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

27
            /** @scrutinizer ignore-deprecated */ $treeBuilder->root('maker');

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

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

Loading history...
28
        }
29
30 1
        return $treeBuilder;
31
    }
32
}
33