Completed
Push — master ( 2c026b...1dd487 )
by Beñat
05:32 queued 02:43
created

ApplicationQueriesPass::process()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 8
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
3
/*
4
 * This file is part of the BenGorFile package.
5
 *
6
 * (c) Beñat Espiña <[email protected]>
7
 * (c) Gorka Laucirica <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace BenGorFile\FileBundle\DependencyInjection\Compiler;
14
15
use BenGorFile\FileBundle\DependencyInjection\Compiler\Application\Query\FileOfIdQueryBuilder;
16
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
17
use Symfony\Component\DependencyInjection\ContainerBuilder;
18
19
/**
20
 * Register application queries compiler pass.
21
 *
22
 * Query declaration via PHP allows more
23
 * flexibility with customization extend files.
24
 *
25
 * @author Beñat Espiña <[email protected]>
26
 */
27
class ApplicationQueriesPass implements CompilerPassInterface
28
{
29
    /**
30
     * {@inheritdoc}
31
     */
32
    public function process(ContainerBuilder $container)
33
    {
34
        $config = $container->getParameter('bengor_file.config');
35
36
        foreach ($config['file_class'] as $key => $file) {
37
            (new FileOfIdQueryBuilder($container))->build($key);
38
        }
39
    }
40
}
41