BeelabPaypalExtension   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 5
dl 0
loc 15
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 12 1
1
<?php
2
3
namespace Beelab\PaypalBundle\DependencyInjection;
4
5
use Symfony\Component\Config\FileLocator;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Loader;
8
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
9
10
class BeelabPaypalExtension extends Extension
11
{
12
    public function load(array $configs, ContainerBuilder $container): void
13
    {
14
        $configuration = new Configuration();
15
        $config = $this->processConfiguration($configuration, $configs);
16
        // TODO remove "service_class", as it's deprecated
17
        $container->setParameter('beelab_paypal.service_class', $config['service_class']);
18
        unset($config['service_class']);
19
        $container->setParameter('beelab_paypal.config', $config);
20
21
        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
22
        $loader->load('services.xml');
23
    }
24
}
25