Code Duplication    Length = 12-14 lines in 2 locations

src/logic/DomainTariffManager.php 2 locations

@@ 43-56 (lines=14) @@
40
41
    }
42
43
    public function insert()
44
    {
45
        $data = $this->model->toArray();
46
47
        try {
48
            $result = Tariff::perform('Create', $data);
49
        } catch (ErrorResponseException $e) {
50
            throw new UnprocessableEntityHttpException($e->getMessage(), 0, $e);
51
        }
52
53
        $this->model->id = $result['id'];
54
55
        return true;
56
    }
57
58
    public function update()
59
    {
@@ 58-69 (lines=12) @@
55
        return true;
56
    }
57
58
    public function update()
59
    {
60
        $data = $this->model->toArray();
61
62
        try {
63
            $result = Tariff::perform('Update', $data);
64
        } catch (ErrorResponseException $e) {
65
            throw new UnprocessableEntityHttpException($e->getMessage(), 0, $e);
66
        }
67
68
        return true;
69
    }
70
71
    /**
72
     * @return array