Completed
Push — symfony-3.3 ( e8b928...951e26 )
by Kamil
24:54 queued 03:04
created

SymfonyCompatibilityPass   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 14
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 8 3
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sylius\Bundle\UserBundle\DependencyInjection\Compiler;
13
14
use Sylius\Bundle\UserBundle\Authentication\DefaultAuthenticationSuccessHandler as SyliusDefaultAuthenticationSuccessHandler;
15
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
16
use Symfony\Component\DependencyInjection\ContainerBuilder;
17
use Symfony\Component\Security\Http\Authentication\DefaultAuthenticationSuccessHandler as SymfonyDefaultAuthenticationSuccessHandler;
18
19
/**
20
 * @see SyliusDefaultAuthenticationSuccessHandler
21
 *
22
 * @internal
23
 */
24
final class SymfonyCompatibilityPass implements CompilerPassInterface
25
{
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function process(ContainerBuilder $container)
30
    {
31
        foreach ($container->getDefinitions() as $definition) {
32
            if ($definition->getClass() === SymfonyDefaultAuthenticationSuccessHandler::class) {
33
                $definition->setClass(SyliusDefaultAuthenticationSuccessHandler::class);
34
            }
35
        }
36
    }
37
}
38