AlpixelUserExtension   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A load() 0 9 1
A bindParameters() 0 7 1
1
<?php
2
3
namespace Alpixel\Bundle\UserBundle\DependencyInjection;
4
5
use Symfony\Component\Config\FileLocator;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Loader;
8
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
9
10
class AlpixelUserExtension extends Extension
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    public function load(array $configs, ContainerBuilder $container)
16
    {
17
        $configuration = new Configuration();
18
        $config = $this->processConfiguration($configuration, $configs);
19
        $this->bindParameters($container, 'alpixel_user', $config);
20
21
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
22
        $loader->load('services.yml');
23
    }
24
25
    /**
26
     * Binds the params from config.
27
     *
28
     * @param ContainerBuilder $container Containerbuilder
29
     * @param string           $name      Alias name
30
     * @param array            $config    Configuration Array
31
     */
32
    public function bindParameters(ContainerBuilder $container, $name, $config)
0 ignored issues
show
Unused Code introduced by
The parameter $name is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
33
    {
34
        $container->setParameter('alpixel_user.role_descriptions', $config['role_descriptions']);
35
        $container->setParameter('alpixel_user.firewall_templates', $config['firewall_templates']);
36
        $container->setParameter('alpixel_user.default_login_background_image', $config['default_login_background_image']);
37
        $container->setParameter('alpixel_user.default_login_background_color', $config['default_login_background_color']);
38
    }
39
}
40