Code Duplication    Length = 3-3 lines in 2 locations

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

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

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)