Completed
Push — symfony-3.3 ( b87070...61ed24 )
by Kamil
22:38
created

SymfonyCompatibilityPass::process()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
namespace Sylius\Bundle\CoreBundle\DependencyInjection\Compiler;
4
5
use Sylius\Bundle\CoreBundle\Symfony\DefaultAuthenticationSuccessHandler;
6
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
9
/**
10
 * @see DefaultAuthenticationSuccessHandler
11
 *
12
 * @internal
13
 */
14
final class SymfonyCompatibilityPass implements CompilerPassInterface
15
{
16
    /**
17
     * {@inheritdoc}
18
     */
19
    public function process(ContainerBuilder $container)
20
    {
21
        if (!$container->has('security.authentication.success_handler')) {
22
            return;
23
        }
24
25
        $definition = $container->findDefinition('security.authentication.success_handler');
26
        $definition->setClass(DefaultAuthenticationSuccessHandler::class);
27
    }
28
}
29