TariffCombo   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 36
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getFilter() 0 7 1
1
<?php
2
/**
3
 * Finance module for HiPanel
4
 *
5
 * @link      https://github.com/hiqdev/hipanel-module-finance
6
 * @package   hipanel-module-finance
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\modules\finance\widgets\combo;
12
13
use hiqdev\combo\Combo;
14
use yii\helpers\ArrayHelper;
15
16
class TariffCombo extends Combo
17
{
18
    /** {@inheritdoc} */
19
    public $type = 'tariff/name';
20
21
    /** {@inheritdoc} */
22
    public $name = 'tariff';
23
24
    /** {@inheritdoc} */
25
    public $url = '/finance/tariff/search';
26
27
    /** {@inheritdoc} */
28
    public $_return = ['id'];
29
30
    /** {@inheritdoc} */
31
    public $_rename = ['text' => 'tariff'];
32
33
    public $_primaryFilter = 'tariff_ilike';
34
35
    public $client = '';
36
37
    /**
38
     * @var string the type of tariff
39
     * @see getFilter()
40
     */
41
    public $tariffType;
42
43
    /** {@inheritdoc} */
44
    public function getFilter()
45
    {
46
        return ArrayHelper::merge(parent::getFilter(), [
47
            'type' => ['format' => $this->tariffType],
48
            'client' => ['format' => $this->client],
49
        ]);
50
    }
51
}
52