Completed
Push — master ( 8d3dbf...7592af )
by Paweł
62:36
created

SWPFacebookInstantArticlesExtension   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 4
dl 18
loc 18
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 12 12 2

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

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