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

SymfonyCompatibilityPass   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

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