Code Duplication    Length = 4-4 lines in 2 locations

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

@@ 77-80 (lines=4) @@
74
            $form->addError(new FormError($this->get('translator')->trans('flash.create.error.exists', [], 'runopencode_exchange_rate'), 'flash.create.error.exits'));
75
        }
76
77
        if (!$form->isValid()) {
78
            $this->addFlash('error', $this->get('translator')->trans('flash.form.error', [], 'runopencode_exchange_rate'));
79
            return false;
80
        }
81
82
        return $this->save($rate);
83
    }

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

@@ 95-98 (lines=4) @@
92
         */
93
        $rate = $form->getData()->toRate($exchangeRate);
94
95
        if (!$form->isValid()) {
96
            $this->addFlash('error', $this->get('translator')->trans('flash.form.error', [], 'runopencode_exchange_rate'));
97
            return false;
98
        }
99
100
        return $this->save($rate);
101
    }