Completed
Push — master ( b761d1...3ce292 )
by Marcos
01:23
created

CustomEntityManagerCompilerPass::process()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 10
ccs 0
cts 8
cp 0
rs 9.4285
cc 2
eloc 5
nc 2
nop 1
crap 6
1
<?php
2
3
namespace Gesdinet\JWTRefreshTokenBundle\DependencyInjection\Compiler;
4
5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
8
/**
9
 * CustomUserProviderCompilerPass.
10
 */
11
final class CustomEntityManagerCompilerPass implements CompilerPassInterface
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16
    public function process(ContainerBuilder $container)
17
    {
18
        $customEntityManagerId = $container->getParameter('gesdinet.jwtrefreshtoken.entity_manager.id');
19
        if (!$customEntityManagerId) {
20
            return;
21
        }
22
23
        //replace the base alias
24
        $container->setAlias('gesdinet.jwtrefreshtoken.entity_manager', $customEntityManagerId);
25
    }
26
}
27