Code Duplication    Length = 5-9 lines in 3 locations

src/views/plan/modals/suggestPrices.php 3 locations

@@ 29-33 (lines=5) @@
26
?>
27
28
<?php if ($plan->type === Plan::TYPE_SERVER): ?>
29
    <?php if ($model->isObjectPredefined()) : ?>
30
        <?= $form->field($model, 'object_id')->hiddenInput()->label(false) ?>
31
    <?php else : ?>
32
        <?= $form->field($model, 'object_id')->widget(ServerCombo::class, ['primaryFilter' => 'name_like']) ?>
33
    <?php endif; ?>
34
    <?= $form->field($model, 'template_plan_id')->widget(TemplatePlanCombo::class, [
35
        'plan_id' => $plan->id,
36
        'object_input_type' => $model->isObjectPredefined() ? null : 'server/server',
@@ 46-50 (lines=5) @@
43
        ],
44
    ]) ?>
45
<?php elseif ($plan->type === Plan::TYPE_SWITCH): ?>
46
    <?php if ($model->isObjectPredefined()) : ?>
47
        <?= $form->field($model, 'object_id')->hiddenInput()->label(false) ?>
48
    <?php else : ?>
49
        <?= $form->field($model, 'object_id')->widget(HubCombo::class) ?>
50
    <?php endif; ?>
51
    <?= $form->field($model, 'template_plan_id')->widget(TemplatePlanCombo::class, [
52
        'plan_id' => $plan->id,
53
        'object_input_type' => $model->isObjectPredefined() ? null : 'server/hub',
@@ 74-82 (lines=9) @@
71
        ],
72
    ]) ?>
73
<?php elseif (in_array($plan->type, [Plan::TYPE_VCDN, Plan::TYPE_PCDN], true)): ?>
74
    <?php if ($model->isObjectPredefined()) : ?>
75
        <?= $form->field($model, 'object_id')->hiddenInput()->label(false) ?>
76
    <?php else : ?>
77
        <?= $form->field($model, 'object_id')->widget(ServerCombo::class, [
78
            'primaryFilter' => 'name_like',
79
            /// XXX Looks like managers need CDN tariffs to be applicable to any servers
80
            /// 'filter' => ['type' => ['format' => $plan->type === Plan::TYPE_PCDN ? 'cdnpix' : 'cdn']],
81
        ]) ?>
82
    <?php endif; ?>
83
    <?= $form->field($model, 'template_plan_id')->widget(TemplatePlanCombo::class, [
84
        'plan_id' => $plan->id,
85
        'object_input_type' => $model->isObjectPredefined() ? null : 'server/server',