Completed
Push — master ( bbd65e...2d6d47 )
by Dmitry
05:17
created

OveruseServerPrice   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 25
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 7 1
A attributeLabels() 0 6 1
1
<?php
2
3
namespace hipanel\modules\finance\models;
4
5
use hipanel\base\ModelTrait;
6
use Yii;
7
8
class OveruseServerPrice extends Price
9
{
10
    use ModelTrait;
11
12
    /**
13
     * @return array
14
     */
15
    public function rules(): array
16
    {
17
        $rules = parent::rules();
18
        $rules[] = [['count_aggregated_traffic'], 'boolean', 'trueValue' => 1, 'falseValue' => 0];
19
20
        return $rules;
21
    }
22
23
    /**
24
     * @return array
25
     */
26
    public function attributeLabels(): array
27
    {
28
        return array_merge(parent::attributeLabels(), [
29
            'count_aggregated_traffic' => Yii::t('hipanel.finance.price', 'Calculate aggregated traffic'),
30
        ]);
31
    }
32
}
33