PsyshBundle::build()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 12
ccs 0
cts 0
cp 0
crap 2
rs 9.8666
c 0
b 0
f 0
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 Symfony\Component\DependencyInjection\Compiler\PassConfig;
16
use Symfony\Component\DependencyInjection\ContainerBuilder;
17
use Symfony\Component\HttpKernel\Bundle\Bundle;
18
19
/**
20
 * @author Adrian PALMER <[email protected]>
21
 * @author Théo FIDRY    <[email protected]>
22
 *
23
 * @private
24 6
 */
25
final class PsyshBundle extends Bundle
26 6
{
27
    public function boot(): void
28
    {
29 6
        parent::boot();
30 6
31 6
        $this->container->get('psysh.facade');
32
    }
33
34
    public function build(ContainerBuilder $container): void
35
    {
36
        parent::build($container);
37
38
        // Ensures that AddPsyshCommandPass runs before AddConsoleCommandPass to avoid
39
        // autoconfiguration conflicts.
40
        $container->addCompilerPass(
41
            new AddPsyshCommandPass(),
42
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
43
            10
44
        );
45
    }
46
}
47