SwitchGraphSearch   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
eloc 13
dl 0
loc 35
c 0
b 0
f 0
ccs 0
cts 22
cp 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 5 1
A formName() 0 3 1
A searchAttributes() 0 5 1
A attributeLabels() 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 hipanel\base\SearchModelTrait;
14
use Yii;
15
16
class SwitchGraphSearch extends SwitchGraph
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'], 'integer'],
28
        ];
29
    }
30
31
    public function formName()
32
    {
33
        return '';
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function searchAttributes()
40
    {
41
        return [
42
            'id',
43
            'width',
44
        ];
45
    }
46
47
    public function attributeLabels()
48
    {
49
        return [
50
            'width' => Yii::t('hipanel:server:rrd', 'Width (px)'),
51
        ];
52
    }
53
}
54