Completed
Push — master ( c7e9bf...6c9a09 )
by Théo
01:19
created

PsyshBundle::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 7
rs 9.4285
ccs 0
cts 0
cp 0
crap 2
1
<?php
2
3
/*
4
 * This file is part of the PsyshBundle package.
5
 *
6
 * (c) Théo FIDRY <[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 Fidry\PsyshBundle;
13
14
use Fidry\PsyshBundle\DependencyInjection\Compiler\AddPsyshCommandPass;
15
use Psy\Command\Command;
16
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
17
use Symfony\Component\DependencyInjection\ContainerBuilder;
18
use Symfony\Component\HttpKernel\Bundle\Bundle;
19
20
/**
21
 * @author Adrian PALMER <[email protected]>
22
 * @author Théo FIDRY    <[email protected]>
23
 */
24 6
final class PsyshBundle extends Bundle
25
{
26 6
    public function boot()
27
    {
28
        parent::boot();
29 6
30 6
        $this->container->get('psysh.facade');
31 6
    }
32
33
    public function build(ContainerBuilder $container)
34
    {
35
        parent::build($container);
36
37
        // Ensure that AddPsyshCommandPass runs before AddConsoleCommandPass to avoid autoconfiguration conflicts.
38
        $container->addCompilerPass(new AddPsyshCommandPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, 10);
0 ignored issues
show
Unused Code introduced by
The call to ContainerBuilder::addCompilerPass() has too many arguments starting with 10.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
39
    }
40
}
41