Skip to content

Commit 6ccf9a1

Browse files
committed
Process Rector rule: RemoveUnusedVariableInCatchRector
Signed-off-by: Tim Goudriaan <tim@codedmonkey.com>
1 parent 16e1c43 commit 6ccf9a1

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/Controller/Dashboard/DashboardResetPasswordController.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ public function request(Request $request): Response
3636
$form->handleRequest($request);
3737

3838
if ($form->isSubmitted() && $form->isValid()) {
39-
return $this->processSendingPasswordResetEmail($form->get('email')->getData());
39+
$this->sendPasswordResetEmail($form->get('email')->getData());
40+
41+
return $this->redirectToRoute('dashboard_reset_password_sent');
4042
}
4143

4244
return $this->render('dashboard/reset_password/request.html.twig', [
@@ -102,7 +104,7 @@ public function passwordReset(Request $request, ?string $token = null): Response
102104
]);
103105
}
104106

105-
private function processSendingPasswordResetEmail(string $email): RedirectResponse
107+
private function sendPasswordResetEmail(string $email): void
106108
{
107109
$user = $this->entityManager->getRepository(User::class)->findOneBy([
108110
'email' => $email,
@@ -124,10 +126,9 @@ private function processSendingPasswordResetEmail(string $email): RedirectRespon
124126
$this->mailer->send($email);
125127

126128
$this->setTokenObjectInSession($resetToken);
127-
} catch (ResetPasswordExceptionInterface $exception) {
129+
} catch (ResetPasswordExceptionInterface) {
130+
// Ignore errors generated by ResetPasswordHelper because it's likely caused by throttling.
128131
}
129132
}
130-
131-
return $this->redirectToRoute('dashboard_reset_password_sent');
132133
}
133134
}

0 commit comments

Comments
 (0)