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

Core23LastFmExtension::configureHttpClient()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
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\FileLocator;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
use Symfony\Component\DependencyInjection\Loader;
17
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
18
19
class Core23LastFmExtension extends Extension
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function load(array $configs, ContainerBuilder $container)
25
    {
26
        $configuration = new Configuration();
27
        $config = $this->processConfiguration($configuration, $configs);
28
29
        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
30
        $loader->load('services.xml');
31
32
        $this->configureRoutes($container, $config);
33
        $this->configureApi($container, $config);
34
        $this->configureHttpClient($container, $config);
35
    }
36
37
    /**
38
     * @param ContainerBuilder $container
39
     * @param array            $config
40
     */
41
    private function configureRoutes(ContainerBuilder $container, array $config)
42
    {
43
        $container->setParameter('core23.lastfm.auth_success.redirect_route', $config['auth_success']['route']);
44
        $container->setParameter('core23.lastfm.auth_success.redirect_route_params', $config['auth_success']['route_parameters']);
45
46
        $container->setParameter('core23.lastfm.auth_error.redirect_route', $config['auth_success']['route']);
47
        $container->setParameter('core23.lastfm.auth_error.redirect_route_params', $config['auth_success']['route_parameters']);
48
    }
49
50
    /**
51
     * @param ContainerBuilder $container
52
     * @param array            $config
53
     */
54
    private function configureApi(ContainerBuilder $container, array $config)
55
    {
56
        $container->setParameter('core23.lastfm.api.app_id', $config['api']['app_id']);
57
        $container->setParameter('core23.lastfm.api.shared_secret', $config['api']['shared_secret']);
58
        $container->setParameter('core23.lastfm.api.endpoint', $config['api']['endpoint']);
59
        $container->setParameter('core23.lastfm.api.auth_url', $config['api']['auth_url']);
60
    }
61
62
    /**
63
     * @param ContainerBuilder $container
64
     * @param array            $config
65
     */
66
    private function configureHttpClient(ContainerBuilder $container, array $config)
67
    {
68
        $container->setAlias('core23.lastfm.http.client', $config['http']['client']);
69
        $container->setAlias('core23.lastfm.http.message_factory', $config['http']['message_factory']);
70
    }
71
}
72