IkoeneMarvelApiExtension   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 6
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 15 1
1
<?php
2
3
namespace Ikoene\MarvelApiBundle\DependencyInjection;
4
5
use Symfony\Component\Config\FileLocator;
6
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
9
10
/**
11
 * Class IkoeneMarvelApiExtension
12
 * @package Ikoene\MarvelApiBundle\DependencyInjection
13
 */
14
class IkoeneMarvelApiExtension extends Extension
15
{
16
    public function load(array $configs, ContainerBuilder $container)
17
    {
18
        $configuration = new Configuration();
19
        $config = $this->processConfiguration($configuration, $configs);
20
21
        $loader = new YamlFileLoader(
22
            $container,
23
            new FileLocator(__DIR__ . '/../Resources/config')
24
        );
25
        $loader->load('services.yml');
26
27
        $container->getDefinition('ikoene_marvel_api_client')
28
            ->setArgument(0, $config['public_api_key'])
29
            ->setArgument(1, $config['private_api_key']);
30
    }
31
}
32