SuluValidationExtension::load()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 8
cts 8
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 2
crap 1
1
<?php
2
3
/*
4
 * This file is part of Sulu.
5
 *
6
 * (c) MASSIVE ART WebServices GmbH
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Sulu\Bundle\ValidationBundle\DependencyInjection;
13
14
use Symfony\Component\Config\FileLocator;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
use Symfony\Component\DependencyInjection\Loader;
17
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
18
19
/**
20
 * Class that loads and manages the bundle configuration.
21
 */
22
class SuluValidationExtension extends Extension
23
{
24
    /**
25
     * {@inheritdoc}
26
     */
27 1
    public function load(array $configs, ContainerBuilder $container)
28
    {
29 1
        $configuration = new Configuration();
30 1
        $config = $this->processConfiguration($configuration, $configs);
31
32 1
        $container->setParameter('sulu_validation.schemas', $config['schemas']);
33 1
        $container->setParameter('sulu_validation.schema_cache', $config['schema_cache']);
34
35 1
        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
36 1
        $loader->load('services.xml');
37 1
    }
38
}
39