GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( 3732bd...eba618 )
by Ivan
10:11
created

m160316_102050_create_wish_table   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 2
c 3
b 0
f 1
lcom 0
cbo 3
dl 0
loc 27
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A safeUp() 0 18 1
A safeDown() 0 5 1
1
<?php
2
3
use yii\db\Migration;
4
use app\modules\shop\models\Wishlist;
5
use app\modules\shop\models\WishlistProduct;
6
use app\modules\user\models\User;
7
use app\modules\shop\models\Product;
8
9
class m160316_102050_create_wish_table extends Migration
10
{
11
    public function safeUp()
12
    {
13
        $this->createTable(Wishlist::tableName(), [
14
            'id' => $this->primaryKey(),
15
            'user_id' => $this->integer()->unsigned()->notNull(),
16
            'title' => $this->string()->notNull(),
17
            'default' => $this->boolean()->notNull()->defaultValue(true),
18
        ]);
19
20
        $this->createTable(WishlistProduct::tableName(), [
21
            'id' => $this->primaryKey(),
22
            'wishlist_id' => $this->integer()->notNull(),
23
            'product_id' => $this->integer()->unsigned()->notNull(),
24
            'UNIQUE KEY `ix-wishlist_id-product_id` (`wishlist_id`, `product_id`)',
25
        ]);
26
        $this->addForeignKey('wishlist_product_wishlist_id', WishlistProduct::tableName(), 'wishlist_id', Wishlist::tableName(), 'id', 'CASCADE');
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 146 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
27
        $this->addForeignKey('wishlist_product_product_id', WishlistProduct::tableName(), 'product_id', Product::tableName(), 'id', 'CASCADE');
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 143 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
28
    }
29
30
    public function safeDown()
31
    {
32
        $this->dropTable(WishlistProduct::tableName());
33
        $this->dropTable(Wishlist::tableName());
34
    }
35
}
36