KleijnWebRestETagExtension::load()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 2
1
<?php declare(strict_types = 1);
2
/*
3
 * This file is part of the KleijnWeb\RestETagBundle package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace KleijnWeb\RestETagBundle\DependencyInjection;
10
11
use Symfony\Component\DependencyInjection\ContainerBuilder;
12
use Symfony\Component\Config\FileLocator;
13
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
14
use Symfony\Component\DependencyInjection\Loader;
15
16
/**
17
 * @author John Kleijn <[email protected]>
18
 */
19
class KleijnWebRestETagExtension extends Extension
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function load(array $configs, ContainerBuilder $container)
25
    {
26
        $config = $this->processConfiguration(new Configuration(), $configs);
27
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
28
        $loader->load('services.yml');
29
        $container->setParameter('rest_e_tags.concurrency_control', $config['concurrency_control']);
30
        $container->setParameter('rest_e_tags.child_invalidation_constraint', $config['child_invalidation_constraint']);
31
        $container->setAlias('rest_e_tags.cache', $config['cache']);
32
    }
33
34
    /**
35
     * @return string
36
     */
37
    public function getAlias()
38
    {
39
        return "rest_e_tags";
40
    }
41
}
42