Completed
Push — master ( f57b87...cd81f9 )
by Andrii
27:21 queued 12:20
created

SinglePrice::showPrice()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace hipanel\modules\server\helpers\consumptionPriceFormatter;
4
5
6
use hipanel\modules\server\models\Consumption;
7
use Yii;
8
9
class SinglePrice implements PriceFormatterStrategy
10
{
11
    /**
12
     * @param Consumption $consumption
13
     * @return string
14
     * @throws \yii\base\InvalidConfigException
15
     */
16
    public function showPrice(Consumption $consumption): string
17
    {
18
        return Yii::$app->formatter->asCurrency($consumption->price, $consumption->currency);
0 ignored issues
show
Bug Best Practice introduced by
The property price does not exist on hipanel\modules\server\models\Consumption. Since you implemented __get, consider adding a @property annotation.
Loading history...
Bug Best Practice introduced by
The property currency does not exist on hipanel\modules\server\models\Consumption. Since you implemented __get, consider adding a @property annotation.
Loading history...
19
    }
20
}
21