Code Duplication    Length = 14-14 lines in 2 locations

src/controllers/ServerController.php 2 locations

@@ 408-421 (lines=14) @@
405
                        'class' => RedirectAction::class,
406
                    ],
407
                ],
408
                'on beforeSave' => function (Event $event) {
409
                    /** @var \hipanel\actions\Action $action */
410
                    $action = $event->sender;
411
                    $type = Yii::$app->request->post('type');
412
                    $comment = Yii::$app->request->post('comment');
413
                    if (!empty($type)) {
414
                        foreach ($action->collection->models as $model) {
415
                            $model->setAttributes([
416
                                'type' => $type,
417
                                'comment' => $comment,
418
                            ]);
419
                        }
420
                    }
421
                },
422
            ],
423
            'bulk-enable-block-modal' => [
424
                'class' => PrepareBulkAction::class,
@@ 442-455 (lines=14) @@
439
                        'class' => RedirectAction::class,
440
                    ],
441
                ],
442
                'on beforeSave' => function (Event $event) {
443
                    /** @var \hipanel\actions\Action $action */
444
                    $action = $event->sender;
445
                    $type = Yii::$app->request->post('type');
446
                    $comment = Yii::$app->request->post('comment');
447
                    if (!empty($type)) {
448
                        foreach ($action->collection->models as $model) {
449
                            $model->setAttributes([
450
                                'comment' => $comment,
451
                                'type' => $type,
452
                            ]);
453
                        }
454
                    }
455
                },
456
            ],
457
            'bulk-disable-block-modal' => [
458
                'class' => PrepareBulkAction::class,