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.
Completed
Push — master ( 5ec0dd...6eda4a )
by Pavel
40:15
created

TestMigration   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 28
ccs 19
cts 19
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B up() 0 25 3
1
<?php
2
/**
3
 * @link https://github.com/paulzi/yii2-adjacency-list
4
 * @copyright Copyright (c) 2015 PaulZi <[email protected]>
5
 * @license MIT (https://github.com/paulzi/yii2-adjacency-list/blob/master/LICENSE)
6
 */
7
8
namespace paulzi\adjacencyList\tests\migrations;
9
10
use yii\db\Schema;
11
use yii\db\Migration;
12
13
/**
14
 * @author PaulZi <[email protected]>
15
 */
16
class TestMigration extends Migration
17
{
18 219
    public function up()
19
    {
20 219
        ob_start();
21 219
        $tableOptions = null;
22 219
        if ($this->db->driverName === 'mysql') {
23
            // http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
24 73
            $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
25 73
        }
26
27
        // tree
28 219
        if ($this->db->getTableSchema('{{%tree}}', true) !== null) {
29 215
            $this->dropTable('{{%tree}}');
30 215
        }
31 219
        $this->createTable('{{%tree}}', [
32 219
            'id'        => Schema::TYPE_PK,
33 219
            'parent_id' => Schema::TYPE_INTEGER . ' NULL',
34 219
            'sort'      => Schema::TYPE_INTEGER . ' NOT NULL',
35 219
            'slug'      => Schema::TYPE_STRING . ' NOT NULL',
36 219
        ], $tableOptions);
37 219
        $this->createIndex('parent_sort', '{{%tree}}', ['parent_id', 'sort']);
38
39
        // update cache (sqlite bug)
40 219
        $this->db->getSchema()->getTableSchema('{{%tree}}', true);
41 219
        ob_end_clean();
42 219
    }
43
}
44