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

CasExtension::load()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 2
dl 0
loc 11
ccs 0
cts 6
cp 0
crap 2
rs 10
c 0
b 0
f 0
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