Completed
Push — master ( 6a4ea3...4e0e71 )
by Paweł
11:05
created

SymfonyCompatibilityPass::process()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 8
rs 9.4285
c 1
b 0
f 0
cc 3
eloc 4
nc 3
nop 1
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