Passed
Push — develop ( ba218d...929d5c )
by
unknown
01:43
created

m170127_102220_change_recovery_template::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 10

Duplication

Lines 14
Ratio 100 %

Importance

Changes 0
Metric Value
dl 14
loc 14
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 10
nc 1
nop 0
1
<?php
2
3
use yii\db\Migration;
4
5
class m170127_102220_change_recovery_template extends Migration
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
6
{
7 View Code Duplication
    public function up()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
8
    {
9
        $this->delete('mail_templates', ['key' => 'CHANGE_PASSWORD']);
10
11
        $this->insert('mail_templates', [
12
            'key' => 'RECOVERY_PASSWORD',
13
            'body' => '<p>Hello, {{name}}!</p>'
14
                . '<p>To change your password, click here please {{link}}.</p>'
15
                . '<p>After setting new password you will be automatically logged in.</p>',
16
            'updated_at' => date('Y-m-d H:i:s'),
17
            'name' => 'Password recovery',
18
            'subject' => 'Password recovery'
19
        ]);
20
    }
21
22 View Code Duplication
    public function down()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
23
    {
24
        $this->delete('mail_templates', ['key' => 'RECOVERY_PASSWORD']);
25
26
        $this->insert('mail_templates', [
27
            'key' => 'CHANGE_PASSWORD',
28
            'body' => '<p>Hello, {{name}}!</p>'
29
                . '<p>To change your password, click here please {{link}}.</p>'
30
                . '<p>After setting new password you will be automatically logged in.</p>',
31
            'updated_at' => date('Y-m-d H:i:s'),
32
            'name' => 'Password recovery',
33
            'subject' => 'Password recovery'
34
        ]);
35
    }
36
}
37