Completed
Push — master ( 306a58...e77292 )
by Andrii
10:46 queued 06:36
created

Binding::rules()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 7
rs 10
c 0
b 0
f 0
ccs 0
cts 7
cp 0
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-2018, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\modules\server\models;
12
13
/**
14
 * Class Binding
15
 *
16
 * @author Dmytro Naumenko <[email protected]>
17
 *
18
 */
19
class Binding extends \hipanel\base\Model
20
{
21
    use \hipanel\base\ModelTrait;
22
23
    public function rules()
24
    {
25
        return [
26
            [['device_id', 'switch_id', 'no'], 'integer'],
27
            [
28
                ['port', 'type', 'switch', 'switch_label', 'switch_inn', 'device_ip', 'switch_ip', 'web_iface_only'],
29
                'string',
30
            ],
31
        ];
32
    }
33
34
    public function getTypeWithNo()
35
    {
36
        return $this->type . $this->no;
0 ignored issues
show
Bug Best Practice introduced by
The property no does not exist on hipanel\modules\server\models\Binding. Since you implemented __get, consider adding a @property annotation.
Loading history...
Bug Best Practice introduced by
The property type does not exist on hipanel\modules\server\models\Binding. Since you implemented __get, consider adding a @property annotation.
Loading history...
37
    }
38
}
39