Code Duplication    Length = 4-4 lines in 2 locations

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

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

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

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