U2FAuthenticationExtension::loadInternal()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
/*
4
 * The MIT License (MIT)
5
 *
6
 * Copyright (c) 2018 Spomky-Labs
7
 *
8
 * This software may be modified and distributed under the terms
9
 * of the MIT license.  See the LICENSE file for details.
10
 */
11
12
namespace U2FAuthentication\Bundle\DependencyInjection;
13
14
use Symfony\Component\Config\FileLocator;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
17
use Symfony\Component\HttpKernel\DependencyInjection\ConfigurableExtension;
18
19
class U2FAuthenticationExtension extends ConfigurableExtension
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function getAlias()
25
    {
26
        return 'u2f';
27
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    protected function loadInternal(array $mergedConfig, ContainerBuilder $container)
33
    {
34
        $loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../Resources/config/'));
35
        $loader->load('services.php');
36
37
        $container->setParameter('u2f.application_id', $mergedConfig['application_id']);
38
        $container->setParameter('u2f.issuer_certificates', $mergedConfig['issuer_certificates']);
39
    }
40
}
41