Code Duplication    Length = 3-3 lines in 2 locations

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

@@ 34-36 (lines=3) @@
31
        $formatter = Yii::$app->formatter;
32
33
        $unit = '';
34
        if ($price->getUnitLabel()) {
35
            $unit = ' ' . Yii::t('hipanel:finance', 'per {unit}', ['unit' => $price->getUnitLabel()]);
36
        }
37
38
        $result = [
39
            Html::tag('strong', $formatter->asCurrency($price->price, $price->currency) . $unit),

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

@@ 60-62 (lines=3) @@
57
    public function renderPrice(Price $price): string
58
    {
59
        $unit = $formula = '';
60
        if ($price->getUnitLabel()) {
61
            $unit = ' ' . Yii::t('hipanel:finance', 'per {unit}', ['unit' => $price->getUnitLabel()]);
62
        }
63
64
        if (\count($price->formulaLines()) > 0) {
65
            $formula = ArraySpoiler::widget([