LoevgaardPakkelabelsExtension::load()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 8
nc 1
nop 2
1
<?php
2
3
namespace Loevgaard\PakkelabelsBundle\DependencyInjection;
4
5
use Symfony\Component\Config\FileLocator;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
8
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
9
10
class LoevgaardPakkelabelsExtension extends Extension
11
{
12
    public function load(array $configs, ContainerBuilder $container)
13
    {
14
        $configuration = new Configuration();
15
        $config = $this->processConfiguration($configuration, $configs);
16
17
        $container->setParameter('loevgaard_pakkelabels.api_username', $config['api_username']);
18
        $container->setParameter('loevgaard_pakkelabels.api_password', $config['api_password']);
19
        $container->setParameter('loevgaard_pakkelabels.label_dir', $config['label_dir']);
20
21
        $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
22
        $loader->load('services.yml');
23
    }
24
}
25