AssignSwitchesForm   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 20
ccs 0
cts 7
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 3 1
A tableName() 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\forms;
12
13
use hipanel\base\ModelTrait;
14
use hipanel\modules\server\models\AssignSwitchInterface;
15
use hipanel\modules\server\models\Hub;
16
17
class AssignSwitchesForm extends Hub implements AssignSwitchInterface
18
{
19
    use ModelTrait;
20
21
    protected $switchVariants = ['net', 'kvm', 'pdu', 'rack', 'console', 'location'];
22
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public static function tableName()
27
    {
28
        return 'hub';
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function rules()
35
    {
36
        return array_merge(parent::rules(), $this->defaultSwitchRules(), $this->generateUniqueValidators());
37
    }
38
}
39