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

route-name-type and stubs for Illuminate\Routing #2017

Open
wants to merge 3 commits into
base: 2.x
Choose a base branch
from

Conversation

szepeviktor
Copy link
Collaborator

  • Added or updated tests
  • Documented user facing changes

Resurrect #1734 by @NiclasvanEyk

Changes

Similar to how view names are checked when using view, the functions that generate URLs (route, to_route, Url::signedRoute, etc.) are now checked too. This way a developer gets an error when referring to a route that does not exist.

@calebdw
Copy link
Contributor

calebdw commented Aug 5, 2024

Would it be possible to solve this without introducing a new route-string-name custom phpdoc type? Ideally, I would like to move away from having to override so many of Laravel's doc types through the use of stubs---they're a pain to maintain (especially when you add all the different version into the mix), they easily become out of sync, and they also have a compound effect where if you override a class you tend to have to add other stubs because you can't reference classes in a stub that are not also stubs.

I've been trying to push a lot of the stubs into the framework, and they've generally been amenable to the changes. One of the things that we can't move to the framework is the model-property type, but I've been thinking of some ideas on how to enable the model property check without having to override all the docs (because there's a ton of them). This would also solve #676 as the stubs would not need to be updated. We could still keep the custom type for users to use in app-land, but we would not have to override all the framework stubs

@szepeviktor
Copy link
Collaborator Author

szepeviktor commented Aug 5, 2024

@calebdw I am just the guy doing copy-paste.

My wish is to detect non-existent route names.

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

Successfully merging this pull request may close these issues.

2 participants