Completed
Push — master ( e5c4e9...1f2b71 )
by Matze
07:17
created

RemoveAliases::process()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
3
namespace BrainExe\Core\DependencyInjection\CompilerPass;
4
5
use BrainExe\Core\Annotations\CompilerPass;
6
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
9
/**
10
 * @CompilerPass(type="beforeRemoving")
11
 */
12
class RemoveAliases implements CompilerPassInterface
13
{
14
15
    /**
16
     * {@inheritdoc}
17
     */
18
    public function process(ContainerBuilder $container)
19
    {
20
21
        foreach ($container->getAliases() as $key => $value) {
22
            $container->removeAlias($value);
23
            $container->removeAlias($key);
24
        }
25
    }
26
27
28
}
29