Code Duplication    Length = 8-8 lines in 2 locations

src/AppBundle/Controller/UserController.php 2 locations

@@ 104-111 (lines=8) @@
101
            'validation_groups' => array('registration'),
102
        ]);
103
        $form->handleRequest($request);
104
        if ($form->isSubmitted()) {
105
            if ($form->isValid()) {
106
                $em->persist($user);
107
                $em->flush();
108
109
                return $this->redirect($this->generateUrl("users_list"));
110
            }
111
        }
112
113
        return ['form' => $form->createView()];
114
    }
@@ 133-140 (lines=8) @@
130
            'validation_groups' => array('edit'),
131
        ]);
132
        $form->handleRequest($request);
133
        if ($form->isSubmitted()) {
134
            if ($form->isValid()) {
135
                $em->persist($user);
136
                $em->flush();
137
138
                return $this->redirect($this->generateUrl("users_list"));
139
            }
140
        }
141
142
        return ['form' => $form->createView()];
143
    }