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

ReferralResourceDecorator::displayAmountWithUnit()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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
}