m161119_153348_alter_cart_data::up()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 6

Duplication

Lines 3
Ratio 50 %

Importance

Changes 0
Metric Value
dl 3
loc 6
rs 10
c 0
b 0
f 0
cc 3
nc 2
nop 0
1
<?php
2
3
use yii\db\Migration;
4
5
class m161119_153348_alter_cart_data extends Migration
6
{
7
    public function up()
8
    {
9 View Code Duplication
        if ($this->db->driverName === 'mysql' || $this->db->driverName === 'mariadb') {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
10
            $this->alterColumn('{{%cart}}', 'cartData', 'longtext');
11
        }
12
    }
13
14
    public function down()
15
    {
16 View Code Duplication
        if ($this->db->driverName === 'mysql' || $this->db->driverName === 'mariadb') {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
17
            $this->alterColumn('{{%cart}}', 'cartData', $this->text());
18
        }
19
    }
20
}
21