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

Detection of invalid route names (and perhaps even missing/invalid params) #359

Open
Seldaek opened this issue Jul 14, 2023 · 0 comments
Open

Comments

@Seldaek
Copy link

Seldaek commented Jul 14, 2023

Just a feature idea:

UrlGeneratorInterface::generate as well as proxy methods in the base controller could check if the given route name is part of the defined routes in the application.

When refactoring routes it happens once in a while something gets missed and it occurred to me that PHPStan probably could have saved my ass. If the route is not commonly used it can otherwise go missed for a while until it fails at runtime.

One could even push this further to check param types by looking at the route pattern and what types the linked action require I guess.

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

1 participant