Completed
Push — master ( 3d485f...407dff )
by Paweł
66:49
created

SWPRevisionExtension   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 4
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 9 1
1
<?php
2
3
/*
4
 * This file is part of the Superdesk Publisher Revision Bundle.
5
 *
6
 * Copyright 2017 Sourcefabric z.u. and contributors.
7
 *
8
 * For the full copyright and license information, please see the
9
 * AUTHORS and LICENSE files distributed with this source code.
10
 *
11
 * @copyright 2015 Sourcefabric z.ú
12
 * @license http://www.superdesk.org/license
13
 */
14
15
namespace SWP\Bundle\RevisionBundle\DependencyInjection;
16
17
use SWP\Bundle\StorageBundle\DependencyInjection\Extension\Extension;
18
use SWP\Bundle\StorageBundle\Drivers;
19
use Symfony\Component\DependencyInjection\ContainerBuilder;
20
use Symfony\Component\Config\FileLocator;
21
use Symfony\Component\DependencyInjection\Loader;
22
23
/**
24
 * This is the class that loads and manages your bundle configuration.
25
 *
26
 * @see http://symfony.com/doc/current/cookbook/bundles/extension.html
27
 */
28
class SWPRevisionExtension extends Extension
29
{
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public function load(array $configs, ContainerBuilder $container)
34
    {
35
        $config = $this->processConfiguration(new Configuration(), $configs);
36
37
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
38
        $loader->load('services.yml');
39
40
        $this->registerStorage(Drivers::DRIVER_DOCTRINE_ORM, $config['persistence']['orm']['classes'], $container);
41
    }
42
}
43