Conditions | 1 |
Paths | 1 |
Total Lines | 21 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
1 | <?php |
||
8 | public function safeUp() |
||
9 | { |
||
10 | $this->createTable('lang', [ |
||
11 | 'id' => $this->string(2)->notNull(), |
||
12 | 'locale' => $this->string(8)->notNull(), |
||
13 | 'name' => $this->string(32)->notNull(), |
||
14 | 'status' => $this->smallInteger() |
||
15 | ]); |
||
16 | |||
17 | $this->addPrimaryKey('lang_pk', 'lang', 'id'); |
||
18 | |||
19 | $this->createIndex('lang_name_idx', 'lang', 'name', true); |
||
20 | $this->createIndex('lang_status_idx', 'lang', 'status'); |
||
21 | |||
22 | $this->batchInsert('lang', [ |
||
23 | 'id', 'locale', 'name', 'status' |
||
24 | ], [ |
||
25 | ['en', 'en-US', 'ENG', Lang::STATUS_ACTIVE], |
||
26 | ['ru', 'ru-RU', 'RUS', Lang::STATUS_ACTIVE] |
||
27 | ]); |
||
28 | } |
||
29 | |||
35 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.