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

ApplicationQueriesPass   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 2
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 8 2
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