Code Duplication    Length = 12-14 lines in 6 locations

src/logic/VdsTariffManager.php 2 locations

@@ 36-49 (lines=14) @@
33
        parent::init();
34
    }
35
36
    public function insert()
37
    {
38
        $data = $this->form->toArray();
39
40
        try {
41
            $result = Tariff::perform('create', $data);
42
        } catch (ResponseErrorException $e) {
43
            throw new UnprocessableEntityHttpException($e->getMessage(), 0, $e);
44
        }
45
46
        $this->form->id = $result['id'];
47
48
        return true;
49
    }
50
51
    public function update()
52
    {
@@ 51-62 (lines=12) @@
48
        return true;
49
    }
50
51
    public function update()
52
    {
53
        $data = $this->form->toArray();
54
55
        try {
56
            $result = Tariff::perform('update', $data);
57
        } catch (ResponseErrorException $e) {
58
            throw new UnprocessableEntityHttpException($e->getMessage(), 0, $e);
59
        }
60
61
        return true;
62
    }
63
}
64

src/logic/DomainTariffManager.php 2 locations

@@ 56-69 (lines=14) @@
53
        $this->formOptions['zones'] = $this->getZones();
54
    }
55
56
    public function insert()
57
    {
58
        $data = $this->form->toArray();
59
60
        try {
61
            $result = Tariff::perform('create', $data);
62
        } catch (ResponseErrorException $e) {
63
            throw new UnprocessableEntityHttpException($e->getMessage(), 0, $e);
64
        }
65
66
        $this->form->id = $result['id'];
67
68
        return true;
69
    }
70
71
    public function update()
72
    {
@@ 71-82 (lines=12) @@
68
        return true;
69
    }
70
71
    public function update()
72
    {
73
        $data = $this->form->toArray();
74
75
        try {
76
            $result = Tariff::perform('update', $data);
77
        } catch (ResponseErrorException $e) {
78
            throw new UnprocessableEntityHttpException($e->getMessage(), 0, $e);
79
        }
80
81
        return true;
82
    }
83
84
    protected function getFormOptions()
85
    {

src/logic/ServerTariffManager.php 1 location

@@ 54-65 (lines=12) @@
51
        return true;
52
    }
53
54
    public function update()
55
    {
56
        $data = $this->form->toArray();
57
58
        try {
59
            $result = Tariff::perform('update', $data);
60
        } catch (ResponseErrorException $e) {
61
            throw new UnprocessableEntityHttpException($e->getMessage(), 0, $e);
62
        }
63
64
        return true;
65
    }
66
67
    protected function getFormOptions()
68
    {

src/logic/CertificateTariffManager.php 1 location

@@ 95-106 (lines=12) @@
92
        return true;
93
    }
94
95
    public function update()
96
    {
97
        $data = $this->form->toArray();
98
99
        try {
100
            $result = Tariff::perform('update', $data);
101
        } catch (ResponseErrorException $e) {
102
            throw new UnprocessableEntityHttpException($e->getMessage(), 0, $e);
103
        }
104
105
        return true;
106
    }
107
108
    protected function getFormOptions()
109
    {