WerkspotBingAdsApiExtension   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 12 1
1
<?php
2
namespace Werkspot\BingAdsApiBundle\DependencyInjection;
3
4
use Symfony\Component\Config\FileLocator;
5
use Symfony\Component\DependencyInjection\ContainerBuilder;
6
use Symfony\Component\DependencyInjection\Loader;
7
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
8
9
/**
10
 * This is the class that loads and manages your bundle configuration
11
 *
12
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
13
 */
14
class WerkspotBingAdsApiExtension extends Extension
15
{
16
    /**
17
     * {@inheritdoc}
18
     */
19
    public function load(array $configs, ContainerBuilder $container)
20
    {
21
        $configuration = new Configuration();
22
        $config = $this->processConfiguration($configuration, $configs);
23
24
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
25
        $loader->load('services.yml');
26
27
        // Once the services definition are read, get your service and add a method call to setConfig()
28
        $sillyServiceDefintion = $container->getDefinition('werkspot.bing_ads.api.client');
29
        $sillyServiceDefintion->addMethodCall('setConfig', [$config]);
30
    }
31
}
32