m180910_124715_craft3_upgrade   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A safeUp() 0 6 1
A safeDown() 0 4 1
1
<?php
2
3
namespace dukt\facebook\migrations;
4
5
use craft\db\Migration;
6
use dukt\facebook\widgets\InsightsWidget;
7
8
/**
9
 * m180910_124715_craft3_upgrade migration.
10
 */
11
class m180910_124715_craft3_upgrade extends Migration
12
{
13
    /**
14
     * @inheritdoc
15
     */
16
    public function safeUp()
17
    {
18
        // Widgets
19
        $this->update('{{%widgets}}', [
20
            'type' => InsightsWidget::class
21
        ], ['type' => 'Facebook_Insights']);
22
    }
23
24
    /**
25
     * @inheritdoc
26
     */
27
    public function safeDown()
28
    {
29
        echo "m180910_124715_craft3_upgrade cannot be reverted.\n";
30
        return false;
31
    }
32
}
33