Code Duplication    Length = 8-8 lines in 2 locations

src/AppBundle/Controller/UserController.php 2 locations

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