Code Duplication    Length = 7-8 lines in 4 locations

src/models/Package.php 4 locations

@@ 128-134 (lines=7) @@
125
        return Yii::t('yii', '{nFormatted} GB', ['nFormatted' => (int) $matches[2] / 1024]); // Gb
126
    }
127
128
    protected function getResourceOveruse_ram()
129
    {
130
        return [
131
            'price' => Yii::$app->formatter->asCurrency(4, Yii::$app->params['currency']),
132
            'unit' => Yii::t('yii', '{nFormatted} GB', ['nFormatted' => 1]),
133
        ];
134
    }
135
136
    protected function getResourceTitle_hdd()
137
    {
@@ 148-155 (lines=8) @@
145
        return Yii::t('yii', '{nFormatted} GB', ['nFormatted' => (int) $matches[2]]); // Gb
146
    }
147
148
    protected function getResourceOveruse_hdd()
149
    {
150
        // TODO: extract from overuse resource
151
        return [
152
            'price' => Yii::$app->formatter->asCurrency(0.2, Yii::$app->params['currency']),
153
            'unit' => Yii::t('yii', '{nFormatted} GB', ['nFormatted' => 1]),
154
        ];
155
    }
156
157
    protected function getResourceTitle_ip()
158
    {
@@ 177-184 (lines=8) @@
174
        return $this->getPartByType('chassis')->partno;
175
    }
176
177
    protected function getResourceOveruse_ip()
178
    {
179
        // TODO: extract from overuse resource
180
        return [
181
            'price' => Yii::$app->formatter->asCurrency(3.5, Yii::$app->params['currency']),
182
            'unit' => Yii::t('yii', '{n} IP', ['n' => 1]),
183
        ];
184
    }
185
186
    protected function getResourceTitle_support_time()
187
    {
@@ 207-214 (lines=8) @@
204
        }
205
    }
206
207
    protected function getResourceOveruse_traffic()
208
    {
209
        // TODO: extract from overuse resource
210
        return [
211
            'price' => Yii::$app->formatter->asCurrency(0.02, Yii::$app->params['currency']),
212
            'unit' => Yii::t('yii', '{nFormatted} GB', ['nFormatted' => 1]),
213
        ];
214
    }
215
216
    protected function getResourceTitle_traffic()
217
    {