RapidoExtension   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 16
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A load() 0 10 1
A prepend() 0 2 1
1
<?php
2
3
namespace Avoran\RapidoBundle\DependencyInjection;
4
5
use Symfony\Component\Config\FileLocator;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
8
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
9
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
10
11
class RapidoExtension extends Extension implements PrependExtensionInterface
12
{
13
    public function load(array $configs, ContainerBuilder $container)
14
    {
15
        $config = $this->processConfiguration(new Configuration(), $configs);
16
        $container->setParameter('rapido.table_name_prefix', $config['table_name_prefix']);
17
        $container->setParameter('rapido.table_name_suffix', $config['table_name_suffix']);
18
        $container->setParameter('rapido.id_column_name', $config['id_column_name']);
19
        $container->setAlias('rapido.database_connection', $config['database_connection']);
20
21
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
22
        $loader->load('services.xml');
23
    }
24
25
    public function prepend(ContainerBuilder $container)
26
    {
27
    }
28
}
29