PsyshBundle   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

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

2 Methods

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