Completed
Pull Request — master (#3)
by Indra
01:55
created

IndragunawanFacadeBundle::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
/*
4
 * This file is part of the FacadeBundle
5
 *
6
 * (c) Indra Gunawan <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Indragunawan\FacadeBundle;
13
14
use Indragunawan\FacadeBundle\DependencyInjection\Compiler\AddFacadePass;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
use Symfony\Component\HttpKernel\Bundle\Bundle;
17
18
/**
19
 * @author Indra Gunawan <[email protected]>
20
 */
21
final class IndragunawanFacadeBundle extends Bundle
22
{
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public function boot()
27
    {
28
        parent::boot();
29
30
        AbstractFacade::setFacadeContainer($this->container->get('indragunawan.facade.container'));
0 ignored issues
show
Documentation introduced by
$this->container->get('i...awan.facade.container') is of type object|null, but the function expects a object<Psr\Container\ContainerInterface>.

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...
31
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36
    public function build(ContainerBuilder $container)
37
    {
38
        parent::build($container);
39
40
        $container->addCompilerPass(new AddFacadePass());
41
    }
42
}
43