Completed
Push — master ( 5e7707...6e3d76 )
by Igor
03:56
created

SettingsForm   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 55
ccs 0
cts 26
cp 0
rs 10
c 1
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 13 1
A attributeLabels() 0 8 1
A attributeHints() 0 7 1
1
<?php
2
3
namespace app\modules\admin\models\forms;
4
5
use Yii;
6
7
class SettingsForm extends \yii\base\Model
8
{
9
    /**
10
     * @var string
11
     */
12
    public $emailMain;
13
    /**
14
     * @var string
15
     */
16
    public $emailName;
17
    /**
18
     * @var string
19
     */
20
    public $emailPrefix;
21
22
    /**
23
     * @inheritdoc
24
     */
25
    public function rules()
26
    {
27
        return [
28
            ['emailMain', 'trim'],
29
            ['emailMain', 'email'],
30
31
            ['emailName', 'trim'],
32
            ['emailName', 'string', 'max' => 255],
33
34
            ['emailPrefix', 'trim'],
35
            ['emailPrefix', 'string', 'max' => 50],
36
        ];
37
    }
38
39
    /**
40
     * @inheritdoc
41
     */
42
    public function attributeLabels()
43
    {
44
        return [
45
            'emailMain' => Yii::t('app', 'Primary email'),
46
            'emailName' => Yii::t('app', 'Sender name'),
47
            'emailPrefix' => Yii::t('app', 'Prefix'),
48
        ];
49
    }
50
51
    /**
52
     * @inheritdoc
53
     */
54
    public function attributeHints()
55
    {
56
        return [
57
            'emailMain' => Yii::t('app', 'All notifications for users go to this address'),
58
            'emailPrefix' => Yii::t('app', 'Subject in the email: "Prefix: Subject"')
59
        ];
60
    }
61
}
62