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.
Completed
Push — master ( 1be80f...2cb972 )
by Christian
06:56
created

Configuration::addRoutingSection()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 27
Code Lines 24

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 27
rs 8.8571
cc 1
eloc 24
nc 1
nop 1
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\LastFmBundle\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
    /**
21
     * {@inheritdoc}
22
     */
23
    public function getConfigTreeBuilder()
24
    {
25
        $treeBuilder = new TreeBuilder();
26
27
        /** @var ArrayNodeDefinition $node */
28
        $node = $treeBuilder->root('core23_lastfm');
29
30
        $this->addApiSection($node);
31
        $this->addHttpClientSection($node);
32
33
        return $treeBuilder;
34
    }
35
36
    /**
37
     * @param ArrayNodeDefinition $node
38
     */
39
    private function addApiSection(ArrayNodeDefinition $node): void
40
    {
41
        $node
42
            ->children()
43
                ->arrayNode('api')
44
                    ->addDefaultsIfNotSet()
45
                    ->children()
46
                        ->scalarNode('app_id')->isRequired()->end()
47
                        ->scalarNode('shared_secret')->isRequired()->end()
48
                        ->scalarNode('endpoint')->defaultValue('http://ws.audioscrobbler.com/2.0/')->end()
49
                        ->scalarNode('auth_url')->defaultValue('http://www.last.fm/api/auth/')->end()
50
                    ->end()
51
                ->end()
52
            ->end();
53
    }
54
55
    /**
56
     * @param ArrayNodeDefinition $node
57
     */
58
    private function addHttpClientSection(ArrayNodeDefinition $node): void
59
    {
60
        $node
61
            ->children()
62
                ->arrayNode('http')
63
                    ->addDefaultsIfNotSet()
64
                    ->children()
65
                        ->scalarNode('client')->defaultValue('httplug.client.default')->end()
66
                        ->scalarNode('message_factory')->defaultValue('httplug.message_factory.default')->end()
67
                    ->end()
68
                ->end()
69
            ->end()
70
        ;
71
    }
72
}
73