Completed
Push — master ( 030796...0c67b5 )
by Asmir
30:13
created

SoapClientExtension::load()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 8
nc 2
nop 2
1
<?php
2
namespace GoetasWebservices\SoapServices\SoapClient\DependencyInjection;
3
4
use Symfony\Component\Config\FileLocator;
5
use Symfony\Component\DependencyInjection\ContainerBuilder;
6
use Symfony\Component\DependencyInjection\Extension\Extension;
7
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
8
9
class SoapClientExtension extends Extension
10
{
11
    public function load(array $configs, ContainerBuilder $container)
12
    {
13
        $config = $this->processConfiguration(new Configuration(), $configs);
14
        foreach ($configs as $subConfig) {
15
            $config = array_merge($config, $subConfig);
16
        }
17
        $container->setParameter('goetas.soap_client.config', $config);
18
        $container->setParameter('goetas.soap_client.unwrap_returns', $config['unwrap_returns']);
19
20
        $xml = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
21
        $xml->load('services.xml');
22
    }
23
24
    protected static function sanitizePhp($ns)
25
    {
26
        return strtr($ns, '/', '\\');
27
    }
28
29
    public function getAlias()
30
    {
31
        return 'soap_client';
32
    }
33
}
34