Address   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 4
dl 0
loc 35
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A find() 0 6 1
A tableName() 0 4 1
A rules() 0 4 1
A attributeLabels() 0 7 1
1
<?php
2
3
namespace hipanel\modules\hosting\models;
4
5
use hipanel\base\ModelTrait;
6
use hipanel\modules\hosting\models\query\AddressQuery;
7
use Yii;
8
use yii\db\QueryInterface;
9
10
class Address extends Prefix
11
{
12
    use ModelTrait;
13
14
    public static function tableName()
15
    {
16
        return 'prefix';
17
    }
18
19
    /** {@inheritdoc} */
20
    public function rules()
21
    {
22
        return parent::rules();
23
    }
24
25
    /** {@inheritdoc} */
26
    public function attributeLabels()
27
    {
28
        return array_merge(parent::attributeLabels(), [
29
            'ip' => Yii::t('hipanel.hosting.ipam', 'Address'),
30
            'type' => Yii::t('hipanel.hosting.ipam', 'Status'),
31
        ]);
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     * @return QueryInterface
37
     */
38
    public static function find(array $options = []): QueryInterface
39
    {
40
        return new AddressQuery(get_called_class(), [
41
            'options' => $options,
42
        ]);
43
    }
44
}
45