Completed
Push — master ( f7bdb9...8d2b6e )
by Andrii
10:42
created

ReferralResourceDecorator   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 17
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A displayTitle() 0 4 1
A displayValue() 0 4 1
A displayAmountWithUnit() 0 4 1
1
<?php
2
3
namespace hipanel\modules\finance\models\decorators\client;
4
5
use Yii;
6
7
class ReferralResourceDecorator extends AbstractClientResourceDecorator
8
{
9
    public function displayTitle()
10
    {
11
        return Yii::t('hipanel:client', 'Referral');
12
    }
13
14
    public function displayValue()
15
    {
16
        return Yii::t('yii', '{nFormatted}', ['nFormatted' => $this->getPrepaidQuantity()]);
17
    }
18
19
    public function displayAmountWithUnit(): string
20
    {
21
        return Yii::$app->formatter->asCurrency($this->getPrepaidQuantity(), $this->displayUnit());
22
    }
23
}