MailCombo::getFilter()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 8
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 8
loc 8
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
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
namespace hipanel\modules\hosting\widgets\combo;
12
13
use hiqdev\combo\Combo;
14
use yii\helpers\ArrayHelper;
15
16
class MailCombo extends Combo
17
{
18
    /** {@inheritdoc} */
19
    public $type = 'hosting/mail';
20
21
    /** {@inheritdoc} */
22
    public $name = 'mail';
23
24
    /** {@inheritdoc} */
25
    public $url = '/hosting/mail/search';
26
27
    /** {@inheritdoc} */
28
    public $_return = ['id', 'account', 'server', 'client'];
29
30
    /** {@inheritdoc} */
31
    public $_rename = ['text' => 'mail'];
32
33
    public $activeWhen = ['server/server'];
34
35
    /** {@inheritdoc} */
36 View Code Duplication
    public function getFilter()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
37
    {
38
        return ArrayHelper::merge(parent::getFilter(), [
39
            'server' => 'server/server',
40
            'account' => 'hosting/account',
41
            'state' => ['format' => 'ok'],
42
        ]);
43
    }
44
45
    /** {@inheritdoc} */
46
    public function getPluginOptions($options = [])
47
    {
48
        return parent::getPluginOptions(ArrayHelper::merge([
49
            'activeWhen' => $this->activeWhen,
50
        ], $options));
51
    }
52
}
53