Code Duplication    Length = 8-8 lines in 2 locations

src/AppBundle/Controller/UserController.php 2 locations

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