SetonoSyliusLagersystemExtension   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 12
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 10 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Setono\SyliusLagersystemPlugin\DependencyInjection;
6
7
use function Safe\sprintf;
8
use Symfony\Component\Config\FileLocator;
9
use Symfony\Component\DependencyInjection\ContainerBuilder;
10
use Symfony\Component\DependencyInjection\Extension\Extension;
11
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
12
13
final class SetonoSyliusLagersystemExtension extends Extension
14
{
15
    public function load(array $config, ContainerBuilder $container): void
16
    {
17
        $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

17
        $config = $this->processConfiguration(/** @scrutinizer ignore-type */ $this->getConfiguration([], $container), $config);
Loading history...
18
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
19
20
        foreach ($config['view_classes'] as $view => $class) {
21
            $container->setParameter(sprintf('setono_sylius_lagersystem.view.%s.class', $view), $class);
22
        }
23
24
        $loader->load('services.xml');
25
    }
26
}
27