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

ConventionedEnumCollectorCompilerPass::process()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
ccs 6
cts 6
cp 1
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
crap 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