SwitchGraphSearch::formName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
c 0
b 0
f 0
ccs 0
cts 3
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
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