Passed
Pull Request — master (#184)
by
unknown
04:04
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
4
This file was created by developers working at BitBag
5
6
Do you need more information about us and what we do? Visit our   website!
7
8
We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career
9
*/
10
declare(strict_types=1);
11
12
namespace BitBag\SyliusElasticsearchPlugin\CompillerPass;
13
14
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
17
final class AuthenticationManagerPolyfillPass implements CompilerPassInterface
18
{
19
    public function process(ContainerBuilder $container)
20
    {
21
        if (
22
            false === $container->has('security.authentication_manager')
23
            &&
24
            true === $container->has('security.authentication.manager')
25
        ) {
26
            $container->setAlias('security.authentication_manager', 'security.authentication.manager');
27
        }
28
    }
29
}
30