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.

OdiseoSyliusReportExtension::load()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 21
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 13
c 1
b 0
f 0
nc 2
nop 2
dl 0
loc 21
rs 9.8333
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Odiseo\SyliusReportPlugin\DependencyInjection;
6
7
use Exception;
8
use Sylius\Bundle\ResourceBundle\DependencyInjection\Extension\AbstractResourceExtension;
9
use Symfony\Component\Config\FileLocator;
10
use Symfony\Component\DependencyInjection\ContainerBuilder;
11
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
12
use Symfony\Component\DependencyInjection\Reference;
13
14
/**
15
 * @author Diego D'amico <[email protected]>
16
 */
17
final class OdiseoSyliusReportExtension extends AbstractResourceExtension
18
{
19
    /**
20
     * {@inheritdoc}
21
     * @throws Exception
22
     */
23
    public function load(array $config, ContainerBuilder $container): void
24
    {
25
        $config = $this->processConfiguration($this->getConfiguration([], $container), $config);
0 ignored issues
show
Bug introduced by
It seems like $this->getConfiguration(array(), $container) can also be of type null; however, parameter $configuration of Symfony\Component\Depend...:processConfiguration() does only seem to accept Symfony\Component\Config...\ConfigurationInterface, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

25
        $config = $this->processConfiguration(/** @scrutinizer ignore-type */ $this->getConfiguration([], $container), $config);
Loading history...
26
        $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
27
28
        $this->registerResources('odiseo_sylius_report', $config['driver'], $config['resources'], $container);
29
30
        $configFiles = [
31
            'services.yml',
32
        ];
33
34
        foreach ($configFiles as $configFile) {
35
            $loader->load($configFile);
36
        }
37
38
        $container
39
            ->getDefinition('odiseo_sylius_report.form.type.report')
40
            ->addArgument(new Reference('odiseo_sylius_report.registry.renderer'))
41
            ->addArgument(new Reference('odiseo_sylius_report.registry.data_fetcher'))
42
            ->addArgument($config['renderer_configuration_template'])
43
            ->addArgument($config['data_fetcher_configuration_template'])
44
        ;
45
    }
46
}
47