Code Duplication    Length = 3-3 lines in 2 locations

src/grid/presenters/price/TemplatePricePresenter.php 1 location

@@ 25-27 (lines=3) @@
22
        $formatter = Yii::$app->formatter;
23
24
        $unit = '';
25
        if ($price->getUnitLabel()) {
26
            $unit = ' ' . Yii::t('hipanel:finance', 'per {unit}', ['unit' => $price->getUnitLabel()]);
27
        }
28
29
        $result = [
30
            Html::tag('strong', $formatter->asCurrency($price->price, $price->currency) . $unit)

src/grid/presenters/price/PricePresenter.php 1 location

@@ 36-38 (lines=3) @@
33
    public function renderPrice($price): string
34
    {
35
        $unit = $formula = '';
36
        if ($price->getUnitLabel()) {
37
            $unit = ' ' . Yii::t('hipanel:finance', 'per {unit}', ['unit' => $price->getUnitLabel()]);
38
        }
39
40
        if ($price->isOveruse()) {
41
            $prepaid = ', ' . Yii::t('hipanel:finance', 'prepaid {amount,number}', ['amount' => $price->quantity]);