ExtractorHandlerCompilerPass::process()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 17
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 4
Bugs 0 Features 0
Metric Value
c 4
b 0
f 0
dl 0
loc 17
rs 9.4285
cc 3
eloc 13
nc 4
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Kreta 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 Kreta\SimpleApiDocBundle\DependencyInjection\Compiler;
14
15
use Nelmio\ApiDocBundle\DependencyInjection\ExtractorHandlerCompilerPass as BaseExtractorHandlerCompilerPass;
16
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
17
use Symfony\Component\DependencyInjection\ContainerBuilder;
18
use Symfony\Component\DependencyInjection\Reference;
19
20
/**
21
 * Extractor Handler Compiler Pass.
22
 *
23
 * @author Beñat Espiña <[email protected]>
24
 */
25
class ExtractorHandlerCompilerPass extends BaseExtractorHandlerCompilerPass implements CompilerPassInterface
26
{
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public function process(ContainerBuilder $container)
31
    {
32
        $handlers = [];
33
        foreach ($container->findTaggedServiceIds('nelmio_api_doc.extractor.handler') as $id => $attributes) {
34
            $handlers[] = new Reference($id);
35
        }
36
        $annotationProviders = [];
37
        foreach ($container->findTaggedServiceIds('nelmio_api_doc.extractor.annotations_provider') as $id => $attributes) {
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 123 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
38
            $annotationProviders[] = new Reference($id);
39
        }
40
        $container
41
            ->getDefinition('kreta_simple_api_doc.extractor.api_doc_extractor')
42
            ->replaceArgument(5, $handlers);
43
        $container
44
            ->getDefinition('kreta_simple_api_doc.extractor.api_doc_extractor')
45
            ->replaceArgument(6, $annotationProviders);
46
    }
47
}
48