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

Binding   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 18
rs 10
c 0
b 0
f 0
ccs 0
cts 14
cp 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 7 1
A getTypeWithNo() 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-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