Completed
Push — 1.0 ( 916c87...0a54d3 )
by Simonas
02:30
created

ONGRElasticsearchExtension   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5
Metric Value
wmc 1
lcom 0
cbo 5
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 13 1
1
<?php
2
3
/*
4
 * This file is part of the ONGR package.
5
 *
6
 * (c) NFQ Technologies UAB <[email protected]>
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 ONGR\ElasticsearchBundle\DependencyInjection;
13
14
use Symfony\Component\Config\FileLocator;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
use Symfony\Component\DependencyInjection\Loader;
17
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
18
19
/**
20
 * This is the class that loads and manages bundle configuration.
21
 */
22
class ONGRElasticsearchExtension extends Extension
23
{
24
    /**
25
     * {@inheritdoc}
26
     */
27
    public function load(array $configs, ContainerBuilder $container)
28
    {
29
        $configuration = new Configuration();
30
        $config = $this->processConfiguration($configuration, $configs);
31
32
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
33
        $loader->load('services.yml');
34
35
        $container->setParameter('es.cache', $config['cache']);
36
        $container->setParameter('es.analysis', $config['analysis']);
37
        $container->setParameter('es.connections', $config['connections']);
38
        $container->setParameter('es.managers', $config['managers']);
39
    }
40
}
41