Completed
Push — master ( fe6d3f...aabe24 )
by ABDULMALIK
05:15 queued 01:45
created

AddDescriptionFieldForPermission::change()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 8
Ratio 100 %

Importance

Changes 0
Metric Value
dl 8
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
4
use Phinx\Migration\AbstractMigration;
5
6 View Code Duplication
class AddDescriptionFieldForPermission 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...
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
7
{
8
    /**
9
     * Change Method.
10
     *
11
     * Write your reversible migrations using this method.
12
     *
13
     * More information on writing migrations is available here:
14
     * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
15
     *
16
     * The following commands can be used in this method and Phinx will
17
     * automatically reverse them when rolling back:
18
     *
19
     *    createTable
20
     *    renameTable
21
     *    addColumn
22
     *    renameColumn
23
     *    addIndex
24
     *    addForeignKey
25
     *
26
     * Remember to call "create()" or "update()" and NOT "save()" when working
27
     * with the Table class.
28
     */
29
    public function change()
30
    {
31
        $permissionTable = $this->table('permission');
32
33
        $permissionTable
34
            ->addColumn('description', 'string', ['null' => true, 'comment' => 'description of permission'])
35
            ->update();
36
    }
37
}
38