Completed
Pull Request — master (#3)
by Indra
03:54
created

IndragunawanFacadeBundle   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 5
dl 0
loc 22
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 6 1
A build() 0 6 1
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