Passed
Push — 1.0 ( 98a200...22fb33 )
by Pol
02:05
created

CasExtension   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 11 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace EcPhp\CasBundle\DependencyInjection;
6
7
use Symfony\Component\Config\FileLocator;
8
use Symfony\Component\DependencyInjection\ContainerBuilder;
9
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
10
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
11
12
/**
13
 * Class CasExtension.
14
 */
15
class CasExtension extends Extension
16
{
17
    /**
18
     * @param array<string> $configs
19
     * @param ContainerBuilder $container
20
     */
21
    public function load(array $configs, ContainerBuilder $container): void
22
    {
23
        $configuration = new Configuration();
24
        $config = $this->processConfiguration($configuration, $configs);
25
26
        // Load CAS configuration.
27
        $container->setParameter('cas', $config);
28
29
        // Load CAS services.
30
        $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
31
        $loader->load('services.yaml');
32
    }
33
}
34