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

LoadSeparateArticlesData   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 30
loc 30
ccs 0
cts 19
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A load() 16 16 2
A getOrder() 4 4 1

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
/*
4
 * This file is part of the Superdesk Web Publisher Fixtures Bundle.
5
 *
6
 * Copyright 2016 Sourcefabric z.ú. 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 2016 Sourcefabric z.ú.
12
 * @license http://www.superdesk.org/license
13
 */
14
15
namespace SWP\Bundle\FixturesBundle\DataFixtures\ORM;
16
17
use Doctrine\Common\DataFixtures\FixtureInterface;
18
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
19
use Doctrine\Common\Persistence\ObjectManager;
20
use SWP\Bundle\FixturesBundle\AbstractFixture;
21
22 View Code Duplication
class LoadSeparateArticlesData extends AbstractFixture implements FixtureInterface, OrderedFixtureInterface
23
{
24
    /**
25
     * {@inheritdoc}
26
     */
27
    public function load(ObjectManager $manager)
28
    {
29
        $env = $this->getEnvironment();
30
31
        if ('test' === $env) {
32
            $this->loadFixtures(
33
                [
34
                    '@SWPFixturesBundle/Resources/fixtures/ORM/'.$env.'/separate_article.yml',
35
                ],
36
                $manager,
37
                [
38
                    'providers' => [$this],
39
                ]
40
            );
41
        }
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function getOrder()
48
    {
49
        return 2;
50
    }
51
}
52