Code Duplication    Length = 11-11 lines in 2 locations

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

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

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

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