Completed
Push — master ( c7a350...473c45 )
by Sergei
38:34
created

ServiceAliasCompilerPass   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 9 1
1
<?php
2
3
namespace Modera\BackendSecurityBundle\DependencyInjection;
4
5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
8
/**
9
 * Adds a service with ID "modera_backend_security.service.mail_service" to service container
10
 * that you can use in your application logic without the need to use specific implementation.
11
 *
12
 * @author    Stas Chychkan <[email protected]>
13
 * @copyright 2015 Modera Foundation
14
 */
15
class ServiceAliasCompilerPass implements CompilerPassInterface
16
{
17
    /**
18
     * {@inheritdoc}
19
     */
20
    public function process(ContainerBuilder $container)
21
    {
22
        $config = $container->getParameter(ModeraBackendSecurityExtension::CONFIG_KEY);
23
24
        $aliasConfig = array();
25
        $aliasConfig['modera_backend_security.service.mail_service'] = $config['mail_service'];
26
27
        $container->addAliases($aliasConfig);
28
    }
29
}
30