@@ -50,10 +50,8 @@ public function __construct(EventDispatcherInterface $eventDispatcher, FactoryIn
5050 */
5151 public function listAction ()
5252 {
53- $ groups = $ this ->groupManager ->findGroups ();
54-
5553 return $ this ->render ('@FOSUser/Group/list.html.twig ' , array (
56- 'groups ' => $ groups ,
54+ 'groups ' => $ this -> groupManager -> findGroups () ,
5755 ));
5856 }
5957
@@ -66,10 +64,8 @@ public function listAction()
6664 */
6765 public function showAction ($ groupName )
6866 {
69- $ group = $ this ->findGroupBy ('name ' , $ groupName );
70-
7167 return $ this ->render ('@FOSUser/Group/show.html.twig ' , array (
72- 'group ' => $ group ,
68+ 'group ' => $ this -> findGroupBy ( ' name ' , $ groupName ) ,
7369 ));
7470 }
7571
@@ -94,20 +90,16 @@ public function editAction(Request $request, $groupName)
9490 return $ event ->getResponse ();
9591 }
9692
97- $ formFactory = $ this ->formFactory ;
98-
99- $ form = $ formFactory ->createForm ();
93+ $ form = $ this ->formFactory ->createForm ();
10094 $ form ->setData ($ group );
10195
10296 $ form ->handleRequest ($ request );
10397
10498 if ($ form ->isSubmitted () && $ form ->isValid ()) {
105- $ groupManager = $ this ->groupManager ;
106-
10799 $ event = new FormEvent ($ form , $ request );
108100 $ dispatcher ->dispatch (FOSUserEvents::GROUP_EDIT_SUCCESS , $ event );
109101
110- $ groupManager ->updateGroup ($ group );
102+ $ this -> groupManager ->updateGroup ($ group );
111103
112104 if (null === $ response = $ event ->getResponse ()) {
113105 $ url = $ this ->generateUrl ('fos_user_group_show ' , array ('groupName ' => $ group ->getName ()));
@@ -135,14 +127,13 @@ public function editAction(Request $request, $groupName)
135127 public function newAction (Request $ request )
136128 {
137129 $ groupManager = $ this ->groupManager ;
138- $ formFactory = $ this ->formFactory ;
139130 $ dispatcher = $ this ->eventDispatcher ;
140131
141132 $ group = $ groupManager ->createGroup ('' );
142133
143134 $ dispatcher ->dispatch (FOSUserEvents::GROUP_CREATE_INITIALIZE , new GroupEvent ($ group , $ request ));
144135
145- $ form = $ formFactory ->createForm ();
136+ $ form = $ this -> formFactory ->createForm ();
146137 $ form ->setData ($ group );
147138
148139 $ form ->handleRequest ($ request );
@@ -183,8 +174,7 @@ public function deleteAction(Request $request, $groupName)
183174
184175 $ response = new RedirectResponse ($ this ->generateUrl ('fos_user_group_list ' ));
185176
186- $ dispatcher = $ this ->eventDispatcher ;
187- $ dispatcher ->dispatch (FOSUserEvents::GROUP_DELETE_COMPLETED , new FilterGroupResponseEvent ($ group , $ request , $ response ));
177+ $ this ->eventDispatcher ->dispatch (FOSUserEvents::GROUP_DELETE_COMPLETED , new FilterGroupResponseEvent ($ group , $ request , $ response ));
188178
189179 return $ response ;
190180 }
0 commit comments