Skip to content

Commit 9993aa3

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

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Controller/Dashboard/DashboardResetPasswordController.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use Doctrine\ORM\EntityManagerInterface;
99
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
1010
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
11-
use Symfony\Component\HttpFoundation\RedirectResponse;
1211
use Symfony\Component\HttpFoundation\Request;
1312
use Symfony\Component\HttpFoundation\Response;
1413
use Symfony\Component\Mailer\MailerInterface;
@@ -36,7 +35,9 @@ public function request(Request $request): Response
3635
$form->handleRequest($request);
3736

3837
if ($form->isSubmitted() && $form->isValid()) {
39-
return $this->processSendingPasswordResetEmail($form->get('email')->getData());
38+
$this->sendPasswordResetEmail($form->get('email')->getData());
39+
40+
return $this->redirectToRoute('dashboard_reset_password_sent');
4041
}
4142

4243
return $this->render('dashboard/reset_password/request.html.twig', [
@@ -102,7 +103,7 @@ public function passwordReset(Request $request, ?string $token = null): Response
102103
]);
103104
}
104105

105-
private function processSendingPasswordResetEmail(string $email): RedirectResponse
106+
private function sendPasswordResetEmail(string $email): void
106107
{
107108
$user = $this->entityManager->getRepository(User::class)->findOneBy([
108109
'email' => $email,
@@ -124,10 +125,9 @@ private function processSendingPasswordResetEmail(string $email): RedirectRespon
124125
$this->mailer->send($email);
125126

126127
$this->setTokenObjectInSession($resetToken);
127-
} catch (ResetPasswordExceptionInterface $exception) {
128+
} catch (ResetPasswordExceptionInterface) {
129+
// Ignore errors generated by ResetPasswordHelper because it's likely caused by throttling.
128130
}
129131
}
130-
131-
return $this->redirectToRoute('dashboard_reset_password_sent');
132132
}
133133
}

0 commit comments

Comments
 (0)