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

CustomEntityManagerCompilerPass   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 16
ccs 0
cts 8
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 10 2
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