Code Duplication    Length = 8-8 lines in 2 locations

src/AppBundle/Controller/UserController.php 2 locations

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