-
-
Notifications
You must be signed in to change notification settings - Fork 424
php8 attributes support for generated controllers #725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,9 +18,13 @@ | |
use SymfonyCasts\Bundle\ResetPassword\Exception\ResetPasswordExceptionInterface; | ||
use SymfonyCasts\Bundle\ResetPassword\ResetPasswordHelperInterface; | ||
|
||
<?php if ($use_attributes) { ?> | ||
#[Route('/reset-password')] | ||
<?php } else { ?> | ||
/** | ||
* @Route("/reset-password") | ||
*/ | ||
<?php } ?> | ||
class <?= $class_name ?> extends AbstractController | ||
{ | ||
use ResetPasswordControllerTrait; | ||
|
@@ -35,8 +39,13 @@ public function __construct(ResetPasswordHelperInterface $resetPasswordHelper) | |
/** | ||
* Display & process form to request a password reset. | ||
* | ||
<?php if ($use_attributes) { ?> | ||
*/ | ||
#[Route('', name: 'app_forgot_password_request')] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the empty There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I also can't remember... it may have been that |
||
<?php } else { ?> | ||
* @Route("", name="app_forgot_password_request") | ||
*/ | ||
<?php } ?> | ||
public function request(Request $request, MailerInterface $mailer): Response | ||
{ | ||
$form = $this->createForm(<?= $request_form_type_class_name ?>::class); | ||
|
@@ -57,8 +66,13 @@ public function request(Request $request, MailerInterface $mailer): Response | |
/** | ||
* Confirmation page after a user has requested a password reset. | ||
* | ||
<?php if ($use_attributes) { ?> | ||
*/ | ||
#[Route('/check-email', name: 'app_check_email')] | ||
<?php } else { ?> | ||
* @Route("/check-email", name="app_check_email") | ||
*/ | ||
<?php } ?> | ||
public function checkEmail(): Response | ||
{ | ||
// We prevent users from directly accessing this page | ||
|
@@ -74,8 +88,13 @@ public function checkEmail(): Response | |
/** | ||
* Validates and process the reset URL that the user clicked in their email. | ||
* | ||
<?php if ($use_attributes) { ?> | ||
*/ | ||
#[Route('/reset/{token}', name: 'app_reset_password')] | ||
<?php } else { ?> | ||
* @Route("/reset/{token}", name="app_reset_password") | ||
*/ | ||
<?php } ?> | ||
public function reset(Request $request, UserPasswordEncoderInterface $passwordEncoder, string $token = null): Response | ||
{ | ||
if ($token) { | ||
|
Uh oh!
There was an error while loading. Please reload this page.