Code Duplication    Length = 11-11 lines in 2 locations

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

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

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

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