AssignSwitchesForm::rules()   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 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
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\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