m180220_081105_create_mediafiles_table   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
c 1
b 0
f 0
dl 0
loc 29
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A safeDown() 0 3 1
A safeUp() 0 15 1
1
<?php
2
3
use yii\db\Migration;
4
5
/**
6
 * Handles the creation of table `mediafiles`.
7
 */
8
class m180220_081105_create_mediafiles_table extends Migration
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function safeUp()
14
    {
15
        $this->createTable('mediafiles', [
16
            'id' => $this->primaryKey(),
0 ignored issues
show
Bug introduced by
The method primaryKey() does not exist on m180220_081105_create_mediafiles_table. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

16
            'id' => $this->/** @scrutinizer ignore-call */ primaryKey(),
Loading history...
17
            'filename' => $this->string(128)->notNull(),
0 ignored issues
show
Bug introduced by
The method string() does not exist on m180220_081105_create_mediafiles_table. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

17
            'filename' => $this->/** @scrutinizer ignore-call */ string(128)->notNull(),
Loading history...
18
            'type' => $this->string(64)->notNull(),
19
            'url' => $this->text()->notNull(),
0 ignored issues
show
Bug introduced by
The method text() does not exist on m180220_081105_create_mediafiles_table. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
            'url' => $this->/** @scrutinizer ignore-call */ text()->notNull(),
Loading history...
20
            'alt' => $this->string(128),
21
            'size' => $this->integer()->notNull(),
0 ignored issues
show
Bug introduced by
The method integer() does not exist on m180220_081105_create_mediafiles_table. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

21
            'size' => $this->/** @scrutinizer ignore-call */ integer()->notNull(),
Loading history...
22
            'title' => $this->string(128),
23
            'description' => $this->text(),
24
            'thumbs' => $this->text(),
25
            'storage' => $this->string(12)->notNull(),
26
            'created_at' => $this->integer()->notNull(),
27
            'updated_at' => $this->integer(),
28
        ]);
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function safeDown()
35
    {
36
        $this->dropTable('mediafiles');
37
    }
38
}
39