PierstovalCharacterManagerExtension::load()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the PierstovalCharacterManagerBundle package.
7
 *
8
 * (c) Alexandre Rock Ancelet <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Pierstoval\Bundle\CharacterManagerBundle\DependencyInjection;
15
16
use Pierstoval\Bundle\CharacterManagerBundle\DependencyInjection\Compiler\StepsPass;
17
use Symfony\Component\Config\FileLocator;
18
use Symfony\Component\DependencyInjection\ContainerBuilder;
19
use Symfony\Component\DependencyInjection\Loader;
20
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
21
22
/**
23
 * This is the class that loads and manages your bundle configuration.
24
 *
25
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
26
 */
27
class PierstovalCharacterManagerExtension extends Extension
28
{
29
    /**
30
     * {@inheritdoc}
31
     */
32
    public function load(array $configs, ContainerBuilder $container): void
33
    {
34
        $configuration = new Configuration();
35
        $config = $this->processConfiguration($configuration, $configs);
36
37
        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
38
        $loader->load('services.xml');
39
40
        // Set all config in container.
41
        // Steps will be validated in compiler pass.
42
        $container->setParameter(StepsPass::PARAMETERS_MANAGERS, $config['managers']);
43
    }
44
}
45