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 1
Paths 1

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.8333
c 0
b 0
f 0
cc 1
nc 1
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\SitemapBundle\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_sitemap');
23
24
        $rootNode = $treeBuilder->getRootNode();
25
26
        \assert($rootNode instanceof ArrayNodeDefinition);
27
28
        $this->addStaticUrlsSection($rootNode);
29
        $this->addCacheSection($rootNode);
30
31
        return $treeBuilder;
32
    }
33
34
    private function addCacheSection(ArrayNodeDefinition $node): void
35
    {
36
        $node
37
            ->children()
38
                ->arrayNode('cache')
39
                    ->addDefaultsIfNotSet()
40
                    ->children()
41
                        ->scalarNode('service')->defaultNull()->end()
42
                    ->end()
43
                ->end()
44
            ->end()
45
        ;
46
    }
47
48
    private function addStaticUrlsSection(ArrayNodeDefinition $node): void
49
    {
50
        $node
51
            ->children()
52
                ->arrayNode('static')
53
                    ->defaultValue([])
54
                    ->prototype('array')
55
                        ->children()
56
                             ->scalarNode('url')->end()
57
                             ->integerNode('priority')->defaultNull()->end()
58
                             ->scalarNode('changefreq')->defaultNull()->end()
59
                        ->end()
60
                    ->end()
61
                ->end()
62
            ->end()
63
        ;
64
    }
65
}
66