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.exits', [], '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

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