Skip to content
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

Some mandatory parameters are missing ("token") to generate a URL for route "app_reset_password". #254

Open
StephanotZaf opened this issue Dec 22, 2022 · 5 comments

Comments

@StephanotZaf
Copy link

If I use php 8.1. I have this error.

@StephanotZaf
Copy link
Author

@weaverryan is exist a solution for this bug?

@spetters
Copy link

spetters commented Feb 2, 2023

@StephanotZaf How do you generate the link? Do you pass the parameter token?

@mattriecken
Copy link

mattriecken commented Feb 3, 2023

@StephanotZaf I ran into this issue just now on Symfony 6.2 & PHP 8.2. The fix for me was to move the "string $token = null" to the end of the function parameters. Not sure why this order mattered, but my IDE was giving me a warning so I moved it around and things started working.

public function reset(Request $request, UserPasswordHasherInterface $passwordHasher, TranslatorInterface $translator, ManagerRegistry $doctrine, string $token = null): Response

@weaverryan
Copy link
Contributor

If anyone hits this, a stacktrace and the code around the error would be awesome :)

Not sure why this order mattered, but my IDE was giving me a warning so I moved it around and things started working.

I don't know if changing the order would change how this functioned, but your editor is right that's it's not correct to have an optional argument and then, later, a required one. If MakerBundle generated the optional arg NOT last, definitely let us know - and thanks for sharing your insight :).

@Merit292005prisy
Copy link

I forgot my learnify.ng password

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants