InjectUntrackedTokenStorageCompilerPass   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 83.33%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 14
ccs 5
cts 6
cp 0.8333
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 11 3
1
<?php
2
3
namespace Kunstmaan\AdminBundle\DependencyInjection\Compiler;
4
5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Reference;
8
9
/**
10
 * @internal
11
 */
12
final class InjectUntrackedTokenStorageCompilerPass implements CompilerPassInterface
13
{
14 3
    public function process(ContainerBuilder $container): void
15
    {
16 3
        if (!$container->has('security.untracked_token_storage')) {
17
            return;
18
        }
19
20
        // NEXT_MAJOR: this compilerpass can be removed when we drop symfony <4.4 support + replace service argument in yaml config
21 3
        if ($container->has('kunstmaan_admin.logger.processor.user')) {
22 3
            $container->getDefinition('kunstmaan_admin.logger.processor.user')->setArgument(0, new Reference('security.untracked_token_storage'));
23
        }
24 3
    }
25
}
26