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::up()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 25

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 17
CRAP Score 3

Importance

Changes 0
Metric Value
dl 0
loc 25
ccs 17
cts 17
cp 1
rs 9.52
c 0
b 0
f 0
cc 3
nc 4
nop 0
crap 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 225
    public function up()
19
    {
20 225
        ob_start();
21 225
        $tableOptions = null;
22 225
        if ($this->db->driverName === 'mysql') {
23
            // http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
24 75
            $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
25
        }
26
27
        // tree
28 225
        if ($this->db->getTableSchema('{{%tree}}', true) !== null) {
29 221
            $this->dropTable('{{%tree}}');
30
        }
31 225
        $this->createTable('{{%tree}}', [
32 225
            'id'        => Schema::TYPE_PK,
33 225
            'parent_id' => Schema::TYPE_INTEGER . ' NULL',
34 225
            'sort'      => Schema::TYPE_INTEGER . ' NOT NULL',
35 225
            'slug'      => Schema::TYPE_STRING . ' NOT NULL',
36 225
        ], $tableOptions);
37 225
        $this->createIndex('parent_sort', '{{%tree}}', ['parent_id', 'sort']);
38
39
        // update cache (sqlite bug)
40 225
        $this->db->getSchema()->getTableSchema('{{%tree}}', true);
41 225
        ob_end_clean();
42 225
    }
43
}
44