Completed
Pull Request — develop (#37)
by Mario
02:16
created

Version0_19_0   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 38
loc 38
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 5 5 1
A up() 4 4 1
A down() 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
namespace App\Migration;
4
5
use Doctrine\DBAL\Schema\Schema;
6
use Doctrine\Migrations\AbstractMigration;
7
use Doctrine\DBAL\Migrations\Version;
8
use Ds\Component\Acl\Migration\Version0_19_0 as Acl;
9
10
/**
11
 * Class Version0_19_0
12
 */
13 View Code Duplication
final class Version0_19_0 extends AbstractMigration
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...
14
{
15
    /**
16
     * @var \Ds\Component\Acl\Migration\Version0_19_0
17
     */
18
    private $acl;
19
20
    /**
21
     * Constructor
22
     *
23
     * @param \Doctrine\DBAL\Migrations\Version  $version
24
     */
25
    public function __construct(Version $version)
26
    {
27
        parent::__construct($version);
28
        $this->acl = new Acl($version);
29
    }
30
31
    /**
32
     * Up migration
33
     *
34
     * @param \Doctrine\DBAL\Schema\Schema $schema
35
     */
36
    public function up(Schema $schema)
37
    {
38
        $this->acl->up($schema);
39
    }
40
41
    /**
42
     * Down migration
43
     *
44
     * @param \Doctrine\DBAL\Schema\Schema $schema
45
     */
46
    public function down(Schema $schema)
47
    {
48
        $this->acl->down($schema);
49
    }
50
}
51