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

__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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