SoftwareSettings   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A scenarioActions() 0 4 1
A primaryKey() 0 3 1
A tableName() 0 3 1
A rules() 0 6 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
class SoftwareSettings extends \hipanel\base\Model
14
{
15
    const SCENARIO_DEFAULT = 'dumb';
16
17
    public static function tableName()
18
    {
19
        return 'server';
20
    }
21
22
    public static function primaryKey()
23
    {
24
        return ['id'];
25
    }
26
27
    public function scenarioActions()
28
    {
29
        return [
30
            'default' => 'set-software-settings',
31
        ];
32
    }
33
34
    public function rules()
35
    {
36
        return [
37
            [['id'], 'integer'],
38
            [['virtual_switch', 'ignore_ip_mon'], 'boolean'],
39
            [['os', 'version', 'ip_mon_comment', 'bw_limit', 'bw_group', 'failure_contacts', 'info'], 'string'],
40
        ];
41
    }
42
}
43