Skip to content

Commit 464d49f

Browse files
committed
fix
1 parent 94c123e commit 464d49f

7 files changed

Lines changed: 34 additions & 34 deletions

Controller/ChangePasswordController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function changePasswordAction(Request $request)
5959
}
6060

6161
$event = new GetResponseUserEvent($user, $request);
62-
$this->eventDispatcher->dispatch(FOSUserEvents::CHANGE_PASSWORD_INITIALIZE, $event);
62+
$this->eventDispatcher->dispatch($event, FOSUserEvents::CHANGE_PASSWORD_INITIALIZE);
6363

6464
if (null !== $event->getResponse()) {
6565
return $event->getResponse();
@@ -72,7 +72,7 @@ public function changePasswordAction(Request $request)
7272

7373
if ($form->isSubmitted() && $form->isValid()) {
7474
$event = new FormEvent($form, $request);
75-
$this->eventDispatcher->dispatch(FOSUserEvents::CHANGE_PASSWORD_SUCCESS, $event);
75+
$this->eventDispatcher->dispatch($event, FOSUserEvents::CHANGE_PASSWORD_SUCCESS);
7676

7777
$this->userManager->updateUser($user);
7878

@@ -81,7 +81,7 @@ public function changePasswordAction(Request $request)
8181
$response = new RedirectResponse($url);
8282
}
8383

84-
$this->eventDispatcher->dispatch(FOSUserEvents::CHANGE_PASSWORD_COMPLETED, new FilterUserResponseEvent($user, $request, $response));
84+
$this->eventDispatcher->dispatch(new FilterUserResponseEvent($user, $request, $response), FOSUserEvents::CHANGE_PASSWORD_COMPLETED);
8585

8686
return $response;
8787
}

Controller/GroupController.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function editAction(Request $request, $groupName)
8383
$group = $this->findGroupBy('name', $groupName);
8484

8585
$event = new GetResponseGroupEvent($group, $request);
86-
$this->eventDispatcher->dispatch(FOSUserEvents::GROUP_EDIT_INITIALIZE, $event);
86+
$this->eventDispatcher->dispatch($event, FOSUserEvents::GROUP_EDIT_INITIALIZE);
8787

8888
if (null !== $event->getResponse()) {
8989
return $event->getResponse();
@@ -96,7 +96,7 @@ public function editAction(Request $request, $groupName)
9696

9797
if ($form->isSubmitted() && $form->isValid()) {
9898
$event = new FormEvent($form, $request);
99-
$this->eventDispatcher->dispatch(FOSUserEvents::GROUP_EDIT_SUCCESS, $event);
99+
$this->eventDispatcher->dispatch($event, FOSUserEvents::GROUP_EDIT_SUCCESS);
100100

101101
$this->groupManager->updateGroup($group);
102102

@@ -105,7 +105,7 @@ public function editAction(Request $request, $groupName)
105105
$response = new RedirectResponse($url);
106106
}
107107

108-
$this->eventDispatcher->dispatch(FOSUserEvents::GROUP_EDIT_COMPLETED, new FilterGroupResponseEvent($group, $request, $response));
108+
$this->eventDispatcher->dispatch(new FilterGroupResponseEvent($group, $request, $response), FOSUserEvents::GROUP_EDIT_COMPLETED);
109109

110110
return $response;
111111
}
@@ -125,7 +125,7 @@ public function newAction(Request $request)
125125
{
126126
$group = $this->groupManager->createGroup('');
127127

128-
$this->eventDispatcher->dispatch(FOSUserEvents::GROUP_CREATE_INITIALIZE, new GroupEvent($group, $request));
128+
$this->eventDispatcher->dispatch(new GroupEvent($group, $request), FOSUserEvents::GROUP_CREATE_INITIALIZE);
129129

130130
$form = $this->formFactory->createForm();
131131
$form->setData($group);
@@ -134,7 +134,7 @@ public function newAction(Request $request)
134134

135135
if ($form->isSubmitted() && $form->isValid()) {
136136
$event = new FormEvent($form, $request);
137-
$this->eventDispatcher->dispatch(FOSUserEvents::GROUP_CREATE_SUCCESS, $event);
137+
$this->eventDispatcher->dispatch($event, FOSUserEvents::GROUP_CREATE_SUCCESS);
138138

139139
$this->groupManager->updateGroup($group);
140140

@@ -143,7 +143,7 @@ public function newAction(Request $request)
143143
$response = new RedirectResponse($url);
144144
}
145145

146-
$this->eventDispatcher->dispatch(FOSUserEvents::GROUP_CREATE_COMPLETED, new FilterGroupResponseEvent($group, $request, $response));
146+
$this->eventDispatcher->dispatch(new FilterGroupResponseEvent($group, $request, $response), FOSUserEvents::GROUP_CREATE_COMPLETED);
147147

148148
return $response;
149149
}
@@ -167,7 +167,7 @@ public function deleteAction(Request $request, $groupName)
167167

168168
$response = new RedirectResponse($this->generateUrl('fos_user_group_list'));
169169

170-
$this->eventDispatcher->dispatch(FOSUserEvents::GROUP_DELETE_COMPLETED, new FilterGroupResponseEvent($group, $request, $response));
170+
$this->eventDispatcher->dispatch(new FilterGroupResponseEvent($group, $request, $response), FOSUserEvents::GROUP_DELETE_COMPLETED);
171171

172172
return $response;
173173
}

Controller/ProfileController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function editAction(Request $request)
7373
}
7474

7575
$event = new GetResponseUserEvent($user, $request);
76-
$this->eventDispatcher->dispatch(FOSUserEvents::PROFILE_EDIT_INITIALIZE, $event);
76+
$this->eventDispatcher->dispatch($event, FOSUserEvents::PROFILE_EDIT_INITIALIZE);
7777

7878
if (null !== $event->getResponse()) {
7979
return $event->getResponse();
@@ -86,7 +86,7 @@ public function editAction(Request $request)
8686

8787
if ($form->isSubmitted() && $form->isValid()) {
8888
$event = new FormEvent($form, $request);
89-
$this->eventDispatcher->dispatch(FOSUserEvents::PROFILE_EDIT_SUCCESS, $event);
89+
$this->eventDispatcher->dispatch($event, FOSUserEvents::PROFILE_EDIT_SUCCESS);
9090

9191
$this->userManager->updateUser($user);
9292

@@ -95,7 +95,7 @@ public function editAction(Request $request)
9595
$response = new RedirectResponse($url);
9696
}
9797

98-
$this->eventDispatcher->dispatch(FOSUserEvents::PROFILE_EDIT_COMPLETED, new FilterUserResponseEvent($user, $request, $response));
98+
$this->eventDispatcher->dispatch(new FilterUserResponseEvent($user, $request, $response), FOSUserEvents::PROFILE_EDIT_COMPLETED);
9999

100100
return $response;
101101
}

Controller/RegistrationController.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function registerAction(Request $request)
5959
$user->setEnabled(true);
6060

6161
$event = new GetResponseUserEvent($user, $request);
62-
$this->eventDispatcher->dispatch(FOSUserEvents::REGISTRATION_INITIALIZE, $event);
62+
$this->eventDispatcher->dispatch($event, FOSUserEvents::REGISTRATION_INITIALIZE);
6363

6464
if (null !== $event->getResponse()) {
6565
return $event->getResponse();
@@ -73,7 +73,7 @@ public function registerAction(Request $request)
7373
if ($form->isSubmitted()) {
7474
if ($form->isValid()) {
7575
$event = new FormEvent($form, $request);
76-
$this->eventDispatcher->dispatch(FOSUserEvents::REGISTRATION_SUCCESS, $event);
76+
$this->eventDispatcher->dispatch($event, FOSUserEvents::REGISTRATION_SUCCESS);
7777

7878
$this->userManager->updateUser($user);
7979

@@ -82,13 +82,13 @@ public function registerAction(Request $request)
8282
$response = new RedirectResponse($url);
8383
}
8484

85-
$this->eventDispatcher->dispatch(FOSUserEvents::REGISTRATION_COMPLETED, new FilterUserResponseEvent($user, $request, $response));
85+
$this->eventDispatcher->dispatch(new FilterUserResponseEvent($user, $request, $response), FOSUserEvents::REGISTRATION_COMPLETED);
8686

8787
return $response;
8888
}
8989

9090
$event = new FormEvent($form, $request);
91-
$this->eventDispatcher->dispatch(FOSUserEvents::REGISTRATION_FAILURE, $event);
91+
$this->eventDispatcher->dispatch($event, FOSUserEvents::REGISTRATION_FAILURE);
9292

9393
if (null !== $response = $event->getResponse()) {
9494
return $response;
@@ -144,7 +144,7 @@ public function confirmAction(Request $request, $token)
144144
$user->setEnabled(true);
145145

146146
$event = new GetResponseUserEvent($user, $request);
147-
$this->eventDispatcher->dispatch(FOSUserEvents::REGISTRATION_CONFIRM, $event);
147+
$this->eventDispatcher->dispatch($event, FOSUserEvents::REGISTRATION_CONFIRM);
148148

149149
$userManager->updateUser($user);
150150

@@ -153,7 +153,7 @@ public function confirmAction(Request $request, $token)
153153
$response = new RedirectResponse($url);
154154
}
155155

156-
$this->eventDispatcher->dispatch(FOSUserEvents::REGISTRATION_CONFIRMED, new FilterUserResponseEvent($user, $request, $response));
156+
$this->eventDispatcher->dispatch(new FilterUserResponseEvent($user, $request, $response), FOSUserEvents::REGISTRATION_CONFIRMED);
157157

158158
return $response;
159159
}

Controller/ResettingController.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ public function sendEmailAction(Request $request)
8080
$user = $this->userManager->findUserByUsernameOrEmail($username);
8181

8282
$event = new GetResponseNullableUserEvent($user, $request);
83-
$this->eventDispatcher->dispatch(FOSUserEvents::RESETTING_SEND_EMAIL_INITIALIZE, $event);
83+
$this->eventDispatcher->dispatch($event, FOSUserEvents::RESETTING_SEND_EMAIL_INITIALIZE);
8484

8585
if (null !== $event->getResponse()) {
8686
return $event->getResponse();
8787
}
8888

8989
if (null !== $user && !$user->isPasswordRequestNonExpired($this->retryTtl)) {
9090
$event = new GetResponseUserEvent($user, $request);
91-
$this->eventDispatcher->dispatch(FOSUserEvents::RESETTING_RESET_REQUEST, $event);
91+
$this->eventDispatcher->dispatch($event, FOSUserEvents::RESETTING_RESET_REQUEST);
9292

9393
if (null !== $event->getResponse()) {
9494
return $event->getResponse();
@@ -99,7 +99,7 @@ public function sendEmailAction(Request $request)
9999
}
100100

101101
$event = new GetResponseUserEvent($user, $request);
102-
$this->eventDispatcher->dispatch(FOSUserEvents::RESETTING_SEND_EMAIL_CONFIRM, $event);
102+
$this->eventDispatcher->dispatch($event, FOSUserEvents::RESETTING_SEND_EMAIL_CONFIRM);
103103

104104
if (null !== $event->getResponse()) {
105105
return $event->getResponse();
@@ -110,7 +110,7 @@ public function sendEmailAction(Request $request)
110110
$this->userManager->updateUser($user);
111111

112112
$event = new GetResponseUserEvent($user, $request);
113-
$this->eventDispatcher->dispatch(FOSUserEvents::RESETTING_SEND_EMAIL_COMPLETED, $event);
113+
$this->eventDispatcher->dispatch($event, FOSUserEvents::RESETTING_SEND_EMAIL_COMPLETED);
114114

115115
if (null !== $event->getResponse()) {
116116
return $event->getResponse();
@@ -155,7 +155,7 @@ public function resetAction(Request $request, $token)
155155
}
156156

157157
$event = new GetResponseUserEvent($user, $request);
158-
$this->eventDispatcher->dispatch(FOSUserEvents::RESETTING_RESET_INITIALIZE, $event);
158+
$this->eventDispatcher->dispatch($event, FOSUserEvents::RESETTING_RESET_INITIALIZE);
159159

160160
if (null !== $event->getResponse()) {
161161
return $event->getResponse();
@@ -168,7 +168,7 @@ public function resetAction(Request $request, $token)
168168

169169
if ($form->isSubmitted() && $form->isValid()) {
170170
$event = new FormEvent($form, $request);
171-
$this->eventDispatcher->dispatch(FOSUserEvents::RESETTING_RESET_SUCCESS, $event);
171+
$this->eventDispatcher->dispatch($event, FOSUserEvents::RESETTING_RESET_SUCCESS);
172172

173173
$this->userManager->updateUser($user);
174174

@@ -178,8 +178,8 @@ public function resetAction(Request $request, $token)
178178
}
179179

180180
$this->eventDispatcher->dispatch(
181-
FOSUserEvents::RESETTING_RESET_COMPLETED,
182-
new FilterUserResponseEvent($user, $request, $response)
181+
new FilterUserResponseEvent($user, $request, $response),
182+
FOSUserEvents::RESETTING_RESET_COMPLETED
183183
);
184184

185185
return $response;

EventListener/AuthenticationListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function authenticate(FilterUserResponseEvent $event, $eventName, EventDi
6262
try {
6363
$this->loginManager->logInUser($this->firewallName, $event->getUser(), $event->getResponse());
6464

65-
$eventDispatcher->dispatch(FOSUserEvents::SECURITY_IMPLICIT_LOGIN, new UserEvent($event->getUser(), $event->getRequest()));
65+
$eventDispatcher->dispatch(new UserEvent($event->getUser(), $event->getRequest()), FOSUserEvents::SECURITY_IMPLICIT_LOGIN);
6666
} catch (AccountStatusException $ex) {
6767
// We simply do not authenticate users which do not pass the user
6868
// checker (not enabled, expired, etc.).

Util/UserManipulator.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function create($username, $password, $email, $active, $superadmin)
7575
$this->userManager->updateUser($user);
7676

7777
$event = new UserEvent($user, $this->getRequest());
78-
$this->dispatcher->dispatch(FOSUserEvents::USER_CREATED, $event);
78+
$this->dispatcher->dispatch($event, FOSUserEvents::USER_CREATED);
7979

8080
return $user;
8181
}
@@ -92,7 +92,7 @@ public function activate($username)
9292
$this->userManager->updateUser($user);
9393

9494
$event = new UserEvent($user, $this->getRequest());
95-
$this->dispatcher->dispatch(FOSUserEvents::USER_ACTIVATED, $event);
95+
$this->dispatcher->dispatch($event, FOSUserEvents::USER_ACTIVATED);
9696
}
9797

9898
/**
@@ -107,7 +107,7 @@ public function deactivate($username)
107107
$this->userManager->updateUser($user);
108108

109109
$event = new UserEvent($user, $this->getRequest());
110-
$this->dispatcher->dispatch(FOSUserEvents::USER_DEACTIVATED, $event);
110+
$this->dispatcher->dispatch($event, FOSUserEvents::USER_DEACTIVATED);
111111
}
112112

113113
/**
@@ -123,7 +123,7 @@ public function changePassword($username, $password)
123123
$this->userManager->updateUser($user);
124124

125125
$event = new UserEvent($user, $this->getRequest());
126-
$this->dispatcher->dispatch(FOSUserEvents::USER_PASSWORD_CHANGED, $event);
126+
$this->dispatcher->dispatch($event, FOSUserEvents::USER_PASSWORD_CHANGED);
127127
}
128128

129129
/**
@@ -138,7 +138,7 @@ public function promote($username)
138138
$this->userManager->updateUser($user);
139139

140140
$event = new UserEvent($user, $this->getRequest());
141-
$this->dispatcher->dispatch(FOSUserEvents::USER_PROMOTED, $event);
141+
$this->dispatcher->dispatch($event, FOSUserEvents::USER_PROMOTED);
142142
}
143143

144144
/**
@@ -153,7 +153,7 @@ public function demote($username)
153153
$this->userManager->updateUser($user);
154154

155155
$event = new UserEvent($user, $this->getRequest());
156-
$this->dispatcher->dispatch(FOSUserEvents::USER_DEMOTED, $event);
156+
$this->dispatcher->dispatch($event, FOSUserEvents::USER_DEMOTED);
157157
}
158158

159159
/**

0 commit comments

Comments
 (0)