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

SinglePrice   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 2
dl 0
loc 10
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A showPrice() 0 3 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