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 ( 74588a...a37fe1 )
by Christian
07:12
created

Configuration::getConfigTreeBuilder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 11
rs 9.4285
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the ni-ju-san CMS.
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
class Configuration implements ConfigurationInterface
19
{
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public function getConfigTreeBuilder()
24
    {
25
        $treeBuilder = new TreeBuilder();
26
        $node = $treeBuilder->root('core23_last_fm');
27
28
        $this->addRoutingSection($node);
29
        $this->addApiSection($node);
30
        $this->addHttpClientSection($node);
31
32
        return $treeBuilder;
33
    }
34
35
    /**
36
     * @param ArrayNodeDefinition $node
37
     */
38
    private function addRoutingSection($node)
39
    {
40
        $node
41
            ->children()
42
                ->arrayNode('auth_success')
43
                    ->addDefaultsIfNotSet()
44
                    ->children()
45
                        ->scalarNode('route')->defaultNull()->end()
46
                        ->arrayNode('route_parameters')
47
                            ->defaultValue(array())
48
                            ->prototype('array')->end()
49
                        ->end()
50
                    ->end()
51
                ->end()
52
                ->arrayNode('auth_error')
53
                    ->addDefaultsIfNotSet()
54
                    ->children()
55
                        ->scalarNode('route')->defaultNull()->end()
56
                        ->arrayNode('route_parameters')
57
                            ->defaultValue(array())
58
                            ->prototype('array')->end()
59
                        ->end()
60
                    ->end()
61
                ->end()
62
            ->end()
63
        ;
64
    }
65
66
    /**
67
     * @param ArrayNodeDefinition $node
68
     */
69
    private function addApiSection(ArrayNodeDefinition $node)
70
    {
71
        $node
72
            ->children()
73
                ->arrayNode('api')
74
                    ->addDefaultsIfNotSet()
75
                    ->children()
76
                        ->scalarNode('app_id')->isRequired()->end()
77
                        ->scalarNode('shared_secret')->isRequired()->end()
78
                        ->scalarNode('endpoint')->defaultValue('http://ws.audioscrobbler.com/2.0/')->end()
79
                        ->scalarNode('auth_url')->defaultValue('http://www.last.fm/api/auth/')->end()
80
                    ->end()
81
                ->end()
82
            ->end();
83
    }
84
85
    /**
86
     * @param ArrayNodeDefinition $node
87
     */
88
    private function addHttpClientSection(ArrayNodeDefinition $node)
89
    {
90
        $node
91
            ->children()
92
                ->arrayNode('http')
93
                    ->addDefaultsIfNotSet()
94
                    ->children()
95
                        ->scalarNode('client')->defaultValue('httplug.client.default')->end()
96
                        ->scalarNode('message_factory')->defaultValue('httplug.message_factory.default')->end()
97
                    ->end()
98
                ->end()
99
            ->end()
100
        ;
101
    }
102
}
103