MailSettings   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 13
c 1
b 0
f 0
dl 0
loc 35
ccs 0
cts 27
cp 0
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 6 1
A primaryKey() 0 3 1
A tableName() 0 3 1
A attributeLabels() 0 5 1
A scenarioActions() 0 4 1
1
<?php
2
/**
3
 * Server module for HiPanel
4
 *
5
 * @link      https://github.com/hiqdev/hipanel-module-server
6
 * @package   hipanel-module-server
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\modules\server\models;
12
13
use Yii;
14
15
class MailSettings extends \hipanel\base\Model
16
{
17
    const SCENARIO_DEFAULT = 'dumb';
18
19
    public static function tableName()
20
    {
21
        return 'server';
22
    }
23
24
    public function rules()
25
    {
26
        return [
27
            [['id'], 'integer'],
28
            [['block_sending'], 'boolean'],
29
            [['per_hour_limit'], 'number'],
30
        ];
31
    }
32
33
    public static function primaryKey()
34
    {
35
        return ['id'];
36
    }
37
38
    public function scenarioActions()
39
    {
40
        return [
41
            'default' => 'set-mail-settings',
42
        ];
43
    }
44
45
    public function attributeLabels()
46
    {
47
        return array_merge(parent::attributeLabels(), [
48
            'per_hour_limit'   => Yii::t('hipanel:server', 'Mails per hour limit'),
49
            'block_sending' => Yii::t('hipanel:server', 'Block sending mail'),
50
        ]);
51
    }
52
}
53