IpSearch   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 4
dl 0
loc 41
ccs 0
cts 30
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A searchAttributes() 0 21 1
A attributeLabels() 0 9 1
1
<?php
2
/**
3
 * Hosting Plugin for HiPanel
4
 *
5
 * @link      https://github.com/hiqdev/hipanel-module-hosting
6
 * @package   hipanel-module-hosting
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/)
9
 */
10
11
/**
12
 * @see    http://hiqdev.com/hipanel-module-hosting
13
 * @license http://hiqdev.com/hipanel-module-hosting/license
14
 * @copyright Copyright (c) 2015 HiQDev
15
 */
16
17
namespace hipanel\modules\hosting\models;
18
19
use hipanel\base\SearchModelTrait;
20
use Yii;
21
use yii\helpers\ArrayHelper;
22
23
class IpSearch extends Ip
24
{
25
    use SearchModelTrait {
26
        searchAttributes as defaultSearchAttributes;
27
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    public function searchAttributes()
33
    {
34
        return ArrayHelper::merge(
35
            $this->defaultSearchAttributes(),
36
            $this->buildAttributeConditions('server'),
37
            $this->buildAttributeConditions('tag'),
38
            $this->buildAttributeConditions('soft'),
39
            $this->buildAttributeConditions('soft_type'),
40
            [
41
                'with_tags',
42
                'with_counters',
43
                'with_expanded_ips',
44
                'show_only_device_link',
45
                'with_links',
46
                'not_tags',
47
                'service_id',
48
                'ips',
49
                'server_inilike',
50
            ]
51
        );
52
    }
53
54
    public function attributeLabels()
55
    {
56
        return ArrayHelper::merge(parent::attributeLabels(), [
57
            'server_in' => Yii::t('hipanel:hosting', 'Servers'),
58
            'server_inilike' => Yii::t('hipanel:hosting', 'Servers'),
59
            'tag_in' => Yii::t('hipanel:hosting', 'Tags'),
60
            'ips' => Yii::t('hipanel:hosting', 'IPs'),
61
        ]);
62
    }
63
}
64