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
    }
@@ 140-147 (lines=8) @@
137
                'attr' => ['class' => 'btn btn-primary'],
138
            ]);
139
        $form->handleRequest($request);
140
        if ($form->isSubmitted()) {
141
            if ($form->isValid()) {
142
                $em->persist($user);
143
                $em->flush();
144
145
                return $this->redirect($this->generateUrl('users_list'));
146
            }
147
        }
148
149
        return ['form' => $form->createView()];
150
    }