Completed
Push — master ( 340290...c9adb3 )
by Michal
02:26
created

AlterIncidents   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 50 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 10
loc 20
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A change() 10 10 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
use Migrations\AbstractMigration;
3
4
class AlterIncidents extends AbstractMigration
5
{
6
    /**
7
     * Change Method.
8
     *
9
     * More information on this method is available here:
10
     * http://docs.phinx.org/en/latest/migrations.html#the-change-method
11
     * @return void
12
     */
13 View Code Duplication
    public function change()
14
    {
15
        $table = $this->table('incidents');
16
        $table->changeColumn('error_message', 'string', [
17
            'default' => null,
18
            'limit' => 200,
19
            'null' => true,
20
        ]);
21
        $table->update();
22
    }
23
}
24