MagentoExtension::load()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
/**
4
 * @project Magento Bridge for Symfony 2.
5
 *
6
 * @author  Sébastien MALOT <[email protected]>
7
 * @license MIT
8
 * @url     <https://github.com/smalot/magento-bundle>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Smalot\MagentoBundle\DependencyInjection;
15
16
use Symfony\Component\DependencyInjection\ContainerBuilder;
17
use Symfony\Component\Config\FileLocator;
18
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
19
use Symfony\Component\DependencyInjection\Loader;
20
21
/**
22
 * Class MagentoExtension
23
 *
24
 * @package Smalot\MagentoBundle\DependencyInjection
25
 */
26
class MagentoExtension extends Extension
27
{
28
    /**
29
     * {@inheritDoc}
30
     */
31
    public function load(array $configs, ContainerBuilder $container)
32
    {
33
        $configuration = new Configuration();
34
        $config        = $this->processConfiguration($configuration, $configs);
35
36
        // Register parameters into container.
37
        $container->setParameter('magento', $config);
38
39
        // Register services.
40
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
41
        $loader->load('services.yml');
42
    }
43
}
44