Completed
Push — master ( cab61f...655000 )
by Matthias
11s
created

SolutionDriveSyliusProductBundlesExtension::load()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace solutionDrive\SyliusProductBundlesPlugin\DependencyInjection;
6
7
use Symfony\Component\Config\FileLocator;
8
use Symfony\Component\DependencyInjection\ContainerBuilder;
9
use Symfony\Component\DependencyInjection\Extension\Extension;
10
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
11
12
final class SolutionDriveSyliusProductBundlesExtension extends Extension
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17
    public function load(array $config, ContainerBuilder $container): void
18
    {
19
        $config = $this->processConfiguration($this->getConfiguration([], $container), $config);
0 ignored issues
show
Documentation introduced by
$this->getConfiguration(array(), $container) is of type object|null, but the function expects a object<Symfony\Component...ConfigurationInterface>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
20
        $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
21
        $loader->load('services.yml');
22
    }
23
}
24