Completed
Push — master ( 4c5d72...05ce3e )
by Andrii
24:03 queued 09:06
created

helpers/consumptionPriceFormatter/SinglePrice.php (2 issues)

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 $consumption->price ? Yii::$app->formatter->asCurrency($consumption->price, $consumption->currency) : '';
0 ignored issues
show
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...
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...
19
    }
20
}
21