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.

TestMigration   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 58
ccs 41
cts 41
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B up() 0 55 5
1
<?php
2
/**
3
 * @link https://github.com/paulzi/yii2-materialized-path
4
 * @copyright Copyright (c) 2015 PaulZi <[email protected]>
5
 * @license MIT (https://github.com/paulzi/yii2-materialized-path/blob/master/LICENSE)
6
 */
7
8
namespace paulzi\materializedPath\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 201
    public function up()
19
    {
20 201
        ob_start();
21 201
        $tableOptions = null;
22 201
        if ($this->db->driverName === 'mysql') {
23
            // http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
24 67
            $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
25
        }
26
27
        // tree
28 201
        if ($this->db->getTableSchema('{{%tree}}', true) !== null) {
29 197
            $this->dropTable('{{%tree}}');
30
        }
31 201
        $this->createTable('{{%tree}}', [
32 201
            'id'    => Schema::TYPE_PK,
33 201
            'path'  => Schema::TYPE_STRING . ' NULL',
34 201
            'depth' => Schema::TYPE_INTEGER . ' NOT NULL',
35 201
            'sort'  => Schema::TYPE_INTEGER . ' NOT NULL',
36 201
            'slug'  => Schema::TYPE_STRING . ' NOT NULL',
37 201
        ], $tableOptions);
38 201
        $this->createIndex('path', '{{%tree}}', ['path']);
39
40
        // attribute mode tree
41 201
        if ($this->db->getTableSchema('{{%attribute_mode_tree}}', true) !== null) {
42 197
            $this->dropTable('{{%attribute_mode_tree}}');
43
        }
44 201
        $this->createTable('{{%attribute_mode_tree}}', [
45 201
            'id'    => Schema::TYPE_PK,
46 201
            'path'  => Schema::TYPE_STRING . ' NULL',
47 201
            'depth' => Schema::TYPE_INTEGER . ' NOT NULL',
48 201
            'sort'  => Schema::TYPE_INTEGER . ' NOT NULL',
49 201
            'slug'  => Schema::TYPE_STRING . ' NOT NULL',
50 201
        ], $tableOptions);
51 201
        $this->createIndex('path2', '{{%attribute_mode_tree}}', ['path']);
52
53
        // multiple tree
54 201
        if ($this->db->getTableSchema('{{%multiple_tree}}', true) !== null) {
55 197
            $this->dropTable('{{%multiple_tree}}');
56
        }
57 201
        $this->createTable('{{%multiple_tree}}', [
58 201
            'id'    => Schema::TYPE_PK,
59 201
            'tree'  => Schema::TYPE_INTEGER . ' NULL',
60 201
            'path'  => Schema::TYPE_STRING . ' NULL',
61 201
            'depth' => Schema::TYPE_INTEGER . ' NOT NULL',
62 201
            'sort'  => Schema::TYPE_INTEGER . ' NOT NULL',
63 201
            'slug'  => Schema::TYPE_STRING . ' NOT NULL',
64 201
        ], $tableOptions);
65 201
        $this->createIndex('path3', '{{%multiple_tree}}', ['tree', 'path']);
66
67
        // update cache (sqlite bug)
68 201
        $this->db->getSchema()->getTableSchema('{{%tree}}', true);
69 201
        $this->db->getSchema()->getTableSchema('{{%attribute_mode_tree}}', true);
70 201
        $this->db->getSchema()->getTableSchema('{{%multiple_tree}}', true);
71 201
        ob_end_clean();
72 201
    }
73
}
74