KleijnWebRestETagExtension   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 5
dl 0
loc 23
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A load() 0 9 1
A getAlias() 0 4 1
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