m180823_193925_clean_identity_table   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 22
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A safeUp() 0 7 1
A safeDown() 0 5 1
1
<?php
2
3
namespace flipbox\saml\sp\migrations;
4
5
use craft\db\Migration;
6
use flipbox\saml\sp\records\ProviderIdentityRecord;
7
8
/**
9
 * m180823_193925_clean_identity_table migration.
10
 */
11
class m180823_193925_clean_identity_table extends Migration
12
{
13
    /**
14
     * @inheritdoc
15
     */
16
    public function safeUp()
17
    {
18
        /**
19
         * We have to do this due to the name id be saved wrongly.
20
         */
21
        ProviderIdentityRecord::deleteAll();
22
    }
23
24
    /**
25
     * @inheritdoc
26
     */
27
    public function safeDown()
28
    {
29
        echo "m180823_193925_clean_identity_table cannot be reverted.\n";
30
        return false;
31
    }
32
}
33