FOSRestPass::process()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 0
cts 8
cp 0
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
crap 6
1
<?php
2
3
namespace Nicofuma\SwaggerBundle\DependencyInjection\Compiler;
4
5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Reference;
8
9
class FOSRestPass implements CompilerPassInterface
10
{
11
    public function process(ContainerBuilder $container)
12
    {
13
        if ($container->hasDefinition('fos_rest.request.param_fetcher')) {
14
            $definition = $container->getDefinition('swagger.fos_rest.request.param_fetcher');
15
            $definition->setDecoratedService('fos_rest.request.param_fetcher');
16
            $definition->replaceArgument(0, new Reference('swagger.fos_rest.request.param_fetcher.inner'));
17
        }
18
    }
19
}
20