RrdSearch   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
eloc 21
dl 0
loc 43
c 0
b 0
f 0
ccs 0
cts 30
cp 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A attributeLabels() 0 7 1
A searchAttributes() 0 8 1
A rules() 0 7 1
A formName() 0 3 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 hipanel\base\SearchModelTrait;
14
use Yii;
15
16
class RrdSearch extends Rrd
17
{
18
    use SearchModelTrait {
19
        searchAttributes as private;
20
        rules as private;
21
    }
22
23
    public function rules()
24
    {
25
        return [
26
            [['id'], 'required'],
27
            [['id', 'width', 'shift'], 'integer'],
28
            [['period'], 'number'],
29
            [['graph'], 'safe'],
30
        ];
31
    }
32
33
    public function formName()
34
    {
35
        return '';
36
    }
37
38
    /**
39
     * {@inheritdoc}
40
     */
41
    public function searchAttributes()
42
    {
43
        return [
44
            'id',
45
            'period',
46
            'width',
47
            'shift',
48
            'graph',
49
        ];
50
    }
51
52
    public function attributeLabels()
53
    {
54
        return [
55
            'graph'  => Yii::t('hipanel:server:rrd', 'Graph'),
56
            'period' => Yii::t('hipanel:server:rrd', 'Precision'),
57
            'shift'  => Yii::t('hipanel:server:rrd', 'Shift (minutes)'),
58
            'width'  => Yii::t('hipanel:server:rrd', 'Width (px)'),
59
        ];
60
    }
61
}
62