Completed
Pull Request — master (#3)
by Jacob
02:10
created

As3ModlrExtension::load()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
rs 9.4285
cc 1
eloc 6
nc 1
nop 2
1
<?php
2
3
namespace As3\Bundle\ModlrBundle\DependencyInjection;
4
5
use Symfony\Component\Config\FileLocator;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Definition;
8
use Symfony\Component\DependencyInjection\Loader;
9
use Symfony\Component\DependencyInjection\Reference;
10
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
11
12
/**
13
 * Loads and manages the bundle configuration for Modlr.
14
 *
15
 * @author  Jacob Bare <[email protected]>
16
 */
17
class As3ModlrExtension extends Extension
18
{
19
    /**
20
     * {@inheritDoc}
21
     */
22
    public function load(array $configs, ContainerBuilder $container)
23
    {
24
        // Process the config.
25
        $config = $this->processConfiguration(new Configuration(), $configs);
26
27
        // Load bundle services.
28
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
29
        $loader->load('services.yml');
30
31
        $serviceLoader = new ServiceLoaderManager($container);
32
        $serviceLoader->loadServices($config);
33
    }
34
}
35