Code Duplication    Length = 11-11 lines in 3 locations

src/RunOpenCode/Bundle/ExchangeRate/Controller/CreateController.php 1 location

@@ 113-123 (lines=11) @@
110
     *
111
     * @return TRUE if successful.
112
     */
113
    protected function save(RateInterface $rate)
114
    {
115
        try {
116
            $this->get('runopencode.exchange_rate.repository')->save([$rate]);
117
            $this->addFlash('success', $this->get('translator')->trans('flash.create.success', [], 'runopencode_exchange_rate'));
118
            return true;
119
        } catch (\Exception $e) {
120
            $this->addFlash('error', $this->get('translator')->trans('flash.create.error.unknown', [], 'runopencode_exchange_rate'));
121
            return false;
122
        }
123
    }
124
125
    /**
126
     * Redirect after success.

src/RunOpenCode/Bundle/ExchangeRate/Controller/EditController.php 1 location

@@ 126-136 (lines=11) @@
123
     * @param RateInterface $rate
124
     * @return TRUE if successful.
125
     */
126
    protected function save(RateInterface $rate)
127
    {
128
        try {
129
            $this->get('runopencode.exchange_rate.repository')->save([$rate]);
130
            $this->addFlash('success', $this->get('translator')->trans('flash.edit.success', [], 'runopencode_exchange_rate'));
131
            return true;
132
        } catch (\Exception $e) {
133
            $this->addFlash('error', $this->get('translator')->trans('flash.edit.error.unknown', [], 'runopencode_exchange_rate'));
134
            return false;
135
        }
136
    }
137
138
    /**
139
     * Redirect after success.

src/RunOpenCode/Bundle/ExchangeRate/Controller/DeleteController.php 1 location

@@ 104-114 (lines=11) @@
101
     *
102
     * @return TRUE if successful.
103
     */
104
    protected function delete(RateInterface $rate)
105
    {
106
        try {
107
            $this->get('runopencode.exchange_rate.repository')->delete([$rate]);
108
            $this->addFlash('success', $this->get('translator')->trans('flash.delete.success', [], 'runopencode_exchange_rate'));
109
            return true;
110
        } catch (\Exception $e) {
111
            $this->addFlash('error', $this->get('translator')->trans('flash.delete.error.unknown', [], 'runopencode_exchange_rate'));
112
            return false;
113
        }
114
    }
115
116
    /**
117
     * Redirect after success.