Completed
Push — master ( 4bb011...4b99be )
by Guillaume
13:23
created

ApiPass::process()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 11
Code Lines 7

Duplication

Lines 11
Ratio 100 %

Importance

Changes 0
Metric Value
dl 11
loc 11
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 7
nc 3
nop 1
1
<?php
2
3
namespace Starkerxp\CampaignBundle\Api;
4
5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Reference;
8
9 View Code Duplication
class ApiPass implements CompilerPassInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
10
{
11
    public function process(ContainerBuilder $container)
12
    {
13
        $definitionId = 'starkerxp_campaign.api.manager';
14
        if (!($container->has($definitionId))) {
15
            return false;
16
        }
17
        $definition = $container->findDefinition($definitionId);
18
        foreach (array_keys($container->findTaggedServiceIds('starkerxp_campaign.api')) as $id) {
19
            $definition->addMethodCall('addApiService', [new Reference($id)]);
20
        }
21
    }
22
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
23