Code Duplication    Length = 8-8 lines in 2 locations

src/AppBundle/Controller/UserController.php 2 locations

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