Code Duplication    Length = 14-14 lines in 2 locations

src/controllers/ServerController.php 2 locations

@@ 400-413 (lines=14) @@
397
                        'class' => RedirectAction::class,
398
                    ],
399
                ],
400
                'on beforeSave' => function (Event $event) {
401
                    /** @var \hipanel\actions\Action $action */
402
                    $action = $event->sender;
403
                    $type = Yii::$app->request->post('type');
404
                    $comment = Yii::$app->request->post('comment');
405
                    if (!empty($type)) {
406
                        foreach ($action->collection->models as $model) {
407
                            $model->setAttributes([
408
                                'type' => $type,
409
                                'comment' => $comment,
410
                            ]);
411
                        }
412
                    }
413
                },
414
            ],
415
            'bulk-enable-block-modal' => [
416
                'class' => PrepareBulkAction::class,
@@ 434-447 (lines=14) @@
431
                        'class' => RedirectAction::class,
432
                    ],
433
                ],
434
                'on beforeSave' => function (Event $event) {
435
                    /** @var \hipanel\actions\Action $action */
436
                    $action = $event->sender;
437
                    $type = Yii::$app->request->post('type');
438
                    $comment = Yii::$app->request->post('comment');
439
                    if (!empty($type)) {
440
                        foreach ($action->collection->models as $model) {
441
                            $model->setAttributes([
442
                                'comment' => $comment,
443
                                'type' => $type,
444
                            ]);
445
                        }
446
                    }
447
                },
448
            ],
449
            'bulk-disable-block-modal' => [
450
                'class' => PrepareBulkAction::class,