Code Duplication    Length = 12-13 lines in 2 locations

src/controllers/TariffController.php 2 locations

@@ 56-68 (lines=13) @@
53
        ];
54
    }
55
56
    public function actionCreateDomain()
57
    {
58
        /** @var DomainTariffManager $manager */
59
        $manager = TariffManagerFactory::createByType('domain');
60
        $form = $manager->form;
61
62
        if (Yii::$app->request->isPost && $form->load(Yii::$app->request->post())) {
63
            $manager->insert();
64
            return $this->redirect(['view', 'id' => $form->id]);
65
        }
66
67
        return $this->render('domain/create', ['model' => $form]);
68
    }
69
70
    public function actionUpdate($id)
71
    {
@@ 70-81 (lines=12) @@
67
        return $this->render('domain/create', ['model' => $form]);
68
    }
69
70
    public function actionUpdate($id)
71
    {
72
        $manager = TariffManagerFactory::createById($id);
73
        $form = $manager->form;
74
75
        if (Yii::$app->request->isPost && $form->load(Yii::$app->request->post())) {
76
            $manager->update();
77
            return $this->redirect(['view', 'id' => $form->id]);
78
        }
79
80
        return $this->render($manager->getType() . '/update', ['model' => $form]);
81
    }
82
83
    public function actionView($id)
84
    {