Code Duplication    Length = 12-13 lines in 2 locations

src/controllers/TicketController.php 2 locations

@@ 276-288 (lines=13) @@
273
     *
274
     * @return \yii\web\Response
275
     */
276
    public function actionPriorityUp($id)
277
    {
278
        $options[$id] = ['id' => $id, 'priority' => 'high'];
279
        if ($this->_ticketChange($options)) {
280
            \Yii::$app->getSession()->setFlash('success',
281
                \Yii::t('hipanel/ticket', 'Priority has been changed to high'));
282
        } else {
283
            \Yii::$app->getSession()->setFlash('error',
284
                \Yii::t('hipanel/ticket', 'Some error occurred! Priority has not been changed to high'));
285
        }
286
287
        return $this->redirect(Yii::$app->request->referrer);
288
    }
289
290
    /**
291
     * @param $id
@@ 295-306 (lines=12) @@
292
     *
293
     * @return \yii\web\Response
294
     */
295
    public function actionPriorityDown($id)
296
    {
297
        $options[$id] = ['id' => $id, 'priority' => 'medium'];
298
        if ($this->_ticketChange($options)) {
299
            \Yii::$app->getSession()->setFlash('success',
300
                \Yii::t('hipanel/ticket', 'Priority has been changed to medium'));
301
        } else {
302
            \Yii::$app->getSession()->setFlash('error', \Yii::t('hipanel/ticket', 'Something goes wrong!'));
303
        }
304
305
        return $this->redirect(Yii::$app->request->referrer);
306
    }
307
308
    /**
309
     * Numerous ticket changes in one method, like BladeRoot did :).