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.

Core23MatomoExtension::load()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 9.6666
c 0
b 0
f 0
cc 2
nc 2
nop 2
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\MatomoBundle\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
final class Core23MatomoExtension extends Extension
20
{
21
    public function load(array $configs, ContainerBuilder $container): void
22
    {
23
        $configuration = new Configuration();
24
        $config        = $this->processConfiguration($configuration, $configs);
25
26
        $bundles = $container->getParameter('kernel.bundles');
27
28
        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
29
30
        $loader->load('services.xml');
31
        $loader->load('twig.xml');
32
33
        if (isset($bundles['SonataBlockBundle'])) {
34
            $loader->load('block.xml');
35
        }
36
37
        $this->configureHttpClient($container, $config);
38
    }
39
40
    private function configureHttpClient(ContainerBuilder $container, array $config): void
41
    {
42
        $container->setAlias('core23_matomo.http.client', $config['http']['client']);
43
        $container->setAlias('core23_matomo.http.message_factory', $config['http']['message_factory']);
44
    }
45
}
46