Passed
Push — master ( a2ed2b...5c220b )
by Gerard
02:12
created

GbereSimpleAuthExtension::load()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 7
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gbere\SimpleAuth\DependencyInjection;
6
7
use Exception;
8
use Symfony\Component\Config\FileLocator;
9
use Symfony\Component\DependencyInjection\ContainerBuilder;
10
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
11
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
12
13
class GbereSimpleAuthExtension extends Extension
14
{
15
    /**
16
     * @throws Exception
17
     */
18
    public function load(array $configs, ContainerBuilder $container): void
19
    {
20
        $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
21
        $loader->load('services.yaml');
22
23
        $configuration = $this->getConfiguration($configs, $container);
24
        $config = $this->processConfiguration($configuration, $configs);
0 ignored issues
show
Bug introduced by
It seems like $configuration 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

24
        $config = $this->processConfiguration(/** @scrutinizer ignore-type */ $configuration, $configs);
Loading history...
Unused Code introduced by
The assignment to $config is dead and can be removed.
Loading history...
25
    }
26
}
27