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
Loading history...
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 |