Completed
Push — master ( 3bca0f...4b95a7 )
by Tomáš
05:03 queued 02:28
created

SymplifyDefaultAutowireBundle   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 7

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 2
Metric Value
wmc 3
c 3
b 0
f 2
lcom 0
cbo 7
dl 0
loc 29
ccs 8
cts 8
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 5 1
A getContainerExtension() 0 4 1
A createDefinitionAnalyzer() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of Symplify
5
 * Copyright (c) 2016 Tomas Votruba (http://tomasvotruba.cz).
6
 */
7
8
namespace Symplify\DefaultAutowire;
9
10
use Symfony\Component\DependencyInjection\ContainerBuilder;
11
use Symfony\Component\HttpKernel\Bundle\Bundle;
12
use Symplify\DefaultAutowire\DependencyInjection\Compiler\DefaultAutowireTypesCompilerPass;
13
use Symplify\DefaultAutowire\DependencyInjection\Compiler\TurnOnAutowireCompilerPass;
14
use Symplify\DefaultAutowire\DependencyInjection\Definition\DefinitionAnalyzer;
15
use Symplify\DefaultAutowire\DependencyInjection\Definition\DefinitionValidator;
16
use Symplify\DefaultAutowire\DependencyInjection\Extension\SymplifyDefaultAutowireContainerExtension;
17
18
final class SymplifyDefaultAutowireBundle extends Bundle
19
{
20
    /**
21
     * @var string
22
     */
23
    const ALIAS = 'symplify_default_autowire';
24
25
    /**
26
     * {@inheritdoc}
27
     */
28 1
    public function build(ContainerBuilder $containerBuilder)
29
    {
30 1
        $containerBuilder->addCompilerPass(new DefaultAutowireTypesCompilerPass());
31 1
        $containerBuilder->addCompilerPass(new TurnOnAutowireCompilerPass($this->createDefinitionAnalyzer()));
32 1
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37 1
    public function getContainerExtension() : SymplifyDefaultAutowireContainerExtension
38
    {
39 1
        return new SymplifyDefaultAutowireContainerExtension();
40
    }
41
42 1
    private function createDefinitionAnalyzer() : DefinitionAnalyzer
43
    {
44 1
        return new DefinitionAnalyzer(new DefinitionValidator());
45
    }
46
}
47