Passed
Push — master ( ed8bf3...cc62e5 )
by Przemysław eRIZ
06:16
created

AuthenticationManagerPolyfillPass::process()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 3
eloc 5
c 1
b 1
f 0
nc 2
nop 1
dl 0
loc 8
rs 10
1
<?php
2
3
namespace BitBag\SyliusCmsPlugin\DependencyInjection\Compiler;
4
5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
8
class AuthenticationManagerPolyfillPass implements CompilerPassInterface
9
{
10
    public function process(ContainerBuilder $container): void
11
    {
12
        if (
13
            $container->has('security.authentication_manager') === false
14
            &&
15
            $container->has('security.authentication.manager') === true
16
        ) {
17
            $container->setAlias('security.authentication_manager', 'security.authentication.manager');
18
        }
19
    }
20
}
21