IndigoCookieConsentExtension   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 4
dl 0
loc 19
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 13 1
1
<?php
2
3
namespace Indigo\Bundle\CookieConsentBundle\DependencyInjection;
4
5
use Symfony\Component\Config\FileLocator;
6
use Symfony\Component\DependencyInjection\Extension\Extension;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
9
10
/**
11
 * @author Márk Sági-Kazár <[email protected]>
12
 */
13
class IndigoCookieConsentExtension extends Extension
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18 2
    public function load(array $configs, ContainerBuilder $container)
19
    {
20 2
        $configuration = $this->getConfiguration($configs, $container);
21 2
        $config = $this->processConfiguration($configuration, $configs);
0 ignored issues
show
Documentation introduced by
$configuration 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...
22
23 2
        $container->setParameter('indigo_cookie_consent', $config);
24
25 2
        $loader = new XmlFileLoader(
26 2
            $container,
27 2
            new FileLocator(__DIR__.'/../Resources/config')
28 2
        );
29 2
        $loader->load('services.xml');
30 2
    }
31
}
32