SymplifyActionAutowireBundle::build()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of Symplify
7
 * Copyright (c) 2015 Tomas Votruba (http://tomasvotruba.cz).
8
 */
9
10
namespace Symplify\ActionAutowire;
11
12
use Symfony\Component\DependencyInjection\ContainerBuilder;
13
use Symfony\Component\HttpKernel\Bundle\Bundle;
14
use Symplify\ActionAutowire\DependencyInjection\Compiler\AddServiceLocatorCompilerPass;
15
use Symplify\ActionAutowire\DependencyInjection\Compiler\ServicesByTypeMapCompilerPass;
16
use Symplify\ActionAutowire\DependencyInjection\Container\ServicesByTypeMap;
17
use Symplify\ActionAutowire\DependencyInjection\Extension\ContainerExtension;
18
19
final class SymplifyActionAutowireBundle extends Bundle
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24 2
    public function getContainerExtension() : ContainerExtension
25
    {
26 2
        return new ContainerExtension();
27
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32 2
    public function build(ContainerBuilder $containerBuilder)
33
    {
34 2
        $serviceByTypeMap = new ServicesByTypeMap();
35 2
        $containerBuilder->addCompilerPass(new ServicesByTypeMapCompilerPass($serviceByTypeMap));
36 2
        $containerBuilder->addCompilerPass(new AddServiceLocatorCompilerPass($serviceByTypeMap));
37 2
    }
38
}
39