DynamicServiceCompilerPass::process()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 14

Duplication

Lines 10
Ratio 71.43 %

Importance

Changes 0
Metric Value
dl 10
loc 14
rs 9.7998
c 0
b 0
f 0
cc 3
nc 4
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * MyPoseo API Bundle
7
 *
8
 * @author Tristan Bessoussa <[email protected]>
9
 */
10
11
namespace Tristanbes\MyPoseoBundle\CompilerPass;
12
13
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
14
use Symfony\Component\DependencyInjection\ContainerBuilder;
15
use Symfony\Component\DependencyInjection\Reference;
16
use Tristanbes\MyPoseoBundle\Connection\RestClient;
17
18
class DynamicServiceCompilerPass implements CompilerPassInterface
19
{
20
    public function process(ContainerBuilder $container): void
21
    {
22 View Code Duplication
        if (null != $container->getParameter('my_poseo.api.cache_service_id')) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
23
            $container->getDefinition(RestClient::class)
24
                ->replaceArgument(3, new Reference($container->getParameter('my_poseo.api.cache_service_id'))
25
            );
26
        }
27
28 View Code Duplication
        if (null != $container->getParameter('my_poseo.api.http_client')) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
29
            $container->getDefinition(RestClient::class)
30
                ->replaceArgument(2, new Reference($container->getParameter('my_poseo.api.http_client'))
31
            );
32
        }
33
    }
34
}
35