BiCoreExtension   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 21
c 0
b 0
f 0
dl 0
loc 36
rs 10
ccs 21
cts 21
cp 1
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 29 1
1
<?php
2
3
namespace Cdf\BiCoreBundle\DependencyInjection;
4
5
use Symfony\Component\DependencyInjection\ContainerBuilder;
6
use Symfony\Component\Config\FileLocator;
7
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
8
use Symfony\Component\DependencyInjection\Loader;
9
10
/**
11
 * This is the class that loads and manages your bundle configuration.
12
 *
13
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
14
 */
15
class BiCoreExtension extends Extension
16
{
17
    /**
18
     * @param mixed[] $configs
19
     *
20
     * @throws \Exception
21
     */
22 2
    public function load(array $configs, ContainerBuilder $container): void
23
    {
24 2
        $configuration = $this->getConfiguration($configs, $container);
25 2
        $config = $this->processConfiguration($configuration, $configs);
0 ignored issues
show
Bug introduced by
It seems like $configuration can also be of type null; however, parameter $configuration of Symfony\Component\Depend...:processConfiguration() does only seem to accept Symfony\Component\Config...\ConfigurationInterface, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

25
        $config = $this->processConfiguration(/** @scrutinizer ignore-type */ $configuration, $configs);
Loading history...
26
27 2
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
28 2
        $loader->load('services.yml');
29 2
        $container->setParameter('bi_core.lockfile', $config['lockfile']);
30 2
        $container->setParameter('bi_core.appname', $config['appname']);
31 2
        $container->setParameter('bi_core.appid', $config['appid']);
32 2
        $container->setParameter('bi_core.solosso', $config['solosso']);
33
34 2
        $container->setParameter('bi_core.table_prefix', $config['table_prefix']);
35 2
        $container->setParameter('bi_core.table_schema', $config['table_schema']);
36
37 2
        $container->setParameter('bi_core.admin4test', $config['admin4test']);
38 2
        $container->setParameter('bi_core.adminpwd4test', $config['adminpwd4test']);
39
40 2
        $container->setParameter('bi_core.usernoroles4test', $config['usernoroles4test']);
41 2
        $container->setParameter('bi_core.usernorolespwd4test', $config['usernorolespwd4test']);
42
43 2
        $container->setParameter('bi_core.userreadroles4test', $config['userreadroles4test']);
44 2
        $container->setParameter('bi_core.userreadrolespwd4test', $config['userreadrolespwd4test']);
45
46 2
        $container->setParameter('bi_core.api_inflector_exceptions', $config['api_inflector_exceptions']);
47
48 2
        $container->setParameter('bi_core.oauth2_enabled', $config['oauth2_enabled']);
49 2
        $container->setParameter('bi_core.oauth2_clientkey', $config['oauth2_clientkey']);
50 2
        $container->setParameter('bi_core.oauth2_endpoint', $config['oauth2_endpoint']);
51
    }
52
}
53