Completed
Pull Request — master (#7)
by Yann
06:37 queued 04:20
created

ConventionedEnumCollectorCompilerPass   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 26
ccs 9
cts 9
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A process() 0 7 2
1
<?php
2
3
namespace EnumBundle\DependencyInjection\CompilerPass;
4
5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
8
/**
9
 * @author Yann Eugoné <[email protected]>
10
 */
11
class ConventionedEnumCollectorCompilerPass implements CompilerPassInterface
12
{
13
    /**
14
     * @var array
15
     */
16
    private $bundles;
17
18
    /**
19
     * @param array $bundles
20
     */
21 3
    public function __construct(array $bundles)
22
    {
23 3
        $this->bundles = $bundles;
24 3
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29 3
    public function process(ContainerBuilder $container)
30
    {
31 3
        foreach ($this->bundles as $bundleClass) {
32 3
            $declarativePass = new DeclarativeEnumCollectorCompilerPass($bundleClass);
33 3
            $declarativePass->process($container);
34 3
        }
35 3
    }
36
}
37