Speicher210FastbillExtension   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 2
c 3
b 0
f 1
lcom 0
cbo 6
dl 0
loc 24
ccs 13
cts 13
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 18 2
1
<?php
2
3
namespace Speicher210\FastbillBundle\DependencyInjection;
4
5
use Symfony\Component\Config\FileLocator;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Loader;
8
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
9
10
/**
11
 * This is the class that loads and manages your bundle configuration
12
 */
13
class Speicher210FastbillExtension extends Extension
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18 3
    public function load(array $configs, ContainerBuilder $container)
19
    {
20 3
        $configuration = new Configuration();
21 3
        $config = $this->processConfiguration($configuration, $configs);
22
23 3
        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
24 3
        $loader->load('services.xml');
25
26 3
        if ($container->getParameter('kernel.debug') === true) {
27 3
            $loader->load('collector.xml');
28 3
        }
29
30
        $container
31 3
            ->getDefinition('speicher210_fastbill.api_credentials')
32 3
            ->addArgument($config['username'])
33 3
            ->addArgument($config['api_key'])
34 3
            ->addArgument($config['account_hash']);
35 3
    }
36
}
37