ApplePassbookExtension::getAlias()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LauLamanApps\ApplePassbookBundle\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\XmlFileLoader;
11
12
final class ApplePassbookExtension extends Extension
13
{
14 1
    public function getAlias()
15
    {
16 1
        return Configuration::ROOT;
17
    }
18
19 5
    public function load(array $configs, ContainerBuilder $container)
20
    {
21 5
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
22 5
        $loader->load('services.xml');
23
24 5
        $configuration = $this->getConfiguration($configs, $container);
25 5
        $config = $this->processConfiguration($configuration, $configs);
0 ignored issues
show
Documentation introduced by
$configuration is of type null|object, 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...
26
27 5
        $definition = $container->getDefinition('laulamanapps_apple_passbook.build.signer');
28 5
        $definition->setArgument(0, $config['certificate']);
29 5
        $definition->setArgument(1, $config['password']);
30
31 5
        $definition = $container->getDefinition('laulamanapps_apple_passbook.build.compiler');
32 5
        $definition->setArgument(3, $config['pass_type_identifier']);
33 5
        $definition->setArgument(4, $config['team_identifier']);
34 5
    }
35
}
36