NexySlackExtension::load()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 12
rs 9.4285
cc 1
eloc 8
nc 1
nop 2
1
<?php
2
3
namespace Nexy\SlackBundle\DependencyInjection;
4
5
use Symfony\Component\Config\FileLocator;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
8
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
9
10
class NexySlackExtension extends Extension
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    public function load(array $configs, ContainerBuilder $container)
16
    {
17
        $configuration = new Configuration();
18
        $config = $this->processConfiguration($configuration, $configs);
19
20
        $container->setParameter('nexy_slack.endpoint', $config['endpoint']);
21
        unset($config['endpoint']);
22
        $container->setParameter('nexy_slack.config', $config);
23
24
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
25
        $loader->load('client.xml');
26
    }
27
}
28