Code Duplication    Length = 14-14 lines in 2 locations

src/controllers/ServerController.php 2 locations

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