ConnecthollandTimechimpExtension::load()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 14
ccs 0
cts 10
cp 0
rs 10
cc 1
nc 1
nop 2
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the timechimp bundle package.
7
 * (c) Connect Holland.
8
 */
9
10
namespace ConnectHolland\TimechimpBundle\DependencyInjection;
11
12
use Symfony\Component\Config\FileLocator;
13
use Symfony\Component\DependencyInjection\ContainerBuilder;
14
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
15
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
16
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
17
18
class ConnecthollandTimechimpExtension extends Extension implements ExtensionInterface
19
{
20
    public function load(array $configs, ContainerBuilder $container)
21
    {
22
        $configuration = new Configuration();
23
24
        $config = $this->processConfiguration($configuration, $configs);
25
26
        $container->setParameter('timechimp.access_token', $config['api_key']);
27
28
        $loader = new YamlFileLoader(
29
            $container,
30
            new FileLocator(__DIR__.'/../Resources/config')
31
        );
32
33
        $loader->load('services.yaml');
34
    }
35
}
36