Code Duplication    Length = 8-8 lines in 2 locations

src/AppBundle/Controller/UserController.php 2 locations

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