Completed
Push — master ( f93802...a3beff )
by Paweł
34:14
created

SWPContentExtension::prepend()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 21
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2.0078

Importance

Changes 0
Metric Value
dl 0
loc 21
ccs 7
cts 8
cp 0.875
rs 9.3142
c 0
b 0
f 0
cc 2
eloc 11
nc 2
nop 1
crap 2.0078
1
<?php
2
3
/*
4
 * This file is part of the Superdesk Web Publisher Content Bundle.
5
 *
6
 * Copyright 2015 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\ContentBundle\DependencyInjection;
16
17
use SWP\Bundle\StorageBundle\Drivers;
18
use SWP\Bundle\StorageBundle\DependencyInjection\Extension\Extension;
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
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
27
 */
28 View Code Duplication
class SWPContentExtension extends Extension
1 ignored issue
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
29
{
30
    /**
31
     * {@inheritdoc}
32
     */
33 1
    public function load(array $configs, ContainerBuilder $container)
34
    {
35 1
        $config = $this->processConfiguration(new Configuration(), $configs);
36 1
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
37 1
        $loader->load('services.yml');
38
39 1
        if ($config['persistence']['orm']['enabled']) {
40 1
            $this->registerStorage(Drivers::DRIVER_DOCTRINE_ORM, $config['persistence']['orm']['classes'], $container);
41 1
            $loader->load('providers.orm.yml');
42
        }
43 1
    }
44
}
45