Code Duplication    Length = 8-8 lines in 2 locations

src/AppBundle/Controller/UserController.php 2 locations

@@ 106-113 (lines=8) @@
103
                'attr' => ['class' => 'btn btn-primary']
104
            ]);
105
        $form->handleRequest($request);
106
        if ($form->isSubmitted()) {
107
            if ($form->isValid()) {
108
                $em->persist($user);
109
                $em->flush();
110
111
                return $this->redirect($this->generateUrl("users_list"));
112
            }
113
        }
114
115
        return ['form' => $form->createView()];
116
    }
@@ 146-153 (lines=8) @@
143
                'attr' => ['class' => 'btn btn-primary']
144
            ]);
145
        $form->handleRequest($request);
146
        if ($form->isSubmitted()) {
147
            if ($form->isValid()) {
148
                $em->persist($user);
149
                $em->flush();
150
151
                return $this->redirect($this->generateUrl("users_list"));
152
            }
153
        }
154
155
        return ['form' => $form->createView()];
156
    }