m161109_124936_rename_cart_table   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 16
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 6 2
A down() 0 6 2
1
<?php
2
3
use yii\db\Migration;
4
5
class m161109_124936_rename_cart_table extends Migration
6
{
7
    public function up()
8
    {
9
        if (Yii::$app->db->schema->getTableSchema('cart') === null) {
10
            $this->renameTable('{{%Cart}}', '{{%cart}}');
11
        }
12
    }
13
14
    public function down()
15
    {
16
        if (Yii::$app->db->schema->getTableSchema('Cart') === null) {
17
            $this->renameTable('{{%cart}}', '{{%Cart}}');
18
        }
19
    }
20
}
21