GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 26

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 26
rs 9.504
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * (c) Christian Gripp <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Core23\DompdfBundle\DependencyInjection;
13
14
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
15
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
16
use Symfony\Component\Config\Definition\ConfigurationInterface;
17
18
final class Configuration implements ConfigurationInterface
19
{
20
    public function getConfigTreeBuilder()
21
    {
22
        $treeBuilder = new TreeBuilder('core23_dompdf');
23
24
        // Keep compatibility with symfony/config < 4.2
25
        if (!method_exists(TreeBuilder::class, 'getRootNode')) {
26
            $rootNode = $treeBuilder->root('core23_dompdf');
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...
27
        } else {
28
            $rootNode = $treeBuilder->getRootNode();
29
        }
30
        \assert($rootNode instanceof ArrayNodeDefinition);
31
32
        $rootNode
33
            ->children()
34
                ->arrayNode('defaults')
35
                    ->useAttributeAsKey('name')
36
                    ->prototype('scalar')->end()
37
                    ->defaultValue([
38
                        'fontCache' => '%kernel.cache_dir%',
39
                    ])
40
                ->end()
41
            ->end()
42
        ;
43
44
        return $treeBuilder;
45
    }
46
}
47