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

OveruseServerPrice::rules()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
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