-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
[7.x] Re-use Router::newRoute()
inside CompiledRouteCollection
#32416
[7.x] Re-use Router::newRoute()
inside CompiledRouteCollection
#32416
Conversation
Router::newRoute()
inside CompiledRouteCollection
Router::newRoute()
inside CompiledRouteCollection
I don't immediately see anything wrong with this so I guess it's fine. Can we remove the |
Redundant invocations of |
Router::newRoute()
inside CompiledRouteCollection
Router::newRoute()
inside CompiledRouteCollection
Router::newRoute()
inside CompiledRouteCollection
Router::newRoute()
inside CompiledRouteCollection
@klimov-paul Your bug report said that current behavior was breaking custom @driesvints A minor update should remain backward compatible and changing a method signature is definitely not. Is it possible to revert this and postponed this change for the next Laravel release? Thanks. |
@pgrenaud given that this has been done since a few releases already I don't think it's wise to revert and do another breaking change for anyone who already adapted their code. |
@driesvints I just notice that I got the version wrong and it's actually since |
@pgrenaud what's your use case for overwriting the method? |
@driesvints We have a custom router that provides localized routes. We added a custom method
Will get routed to the You can find out more here: https://github.com/eXolnet/laravel-translation |
Definitely agree that method signature changes like this should never slip through. However it could be too late now as it may compound the problem. 🤦🏼♂️ |
It is sad to hear someone suffers from this update. class A
{
protected function foo() {}
}
class B extends A
{
public function foo() {} // no error!
} If you release a patch which |
@klimov-paul the problem is that in this case it's the other way around. The upstream is now public but all downstreams who were overriding it are protected. And that does trigger an error. @pgrenaud sorry you got caught by this. We try to pay attention to these things but sometimes things slip through. It's a little late to revert now unfortunately. We'll try to take care of this better in the future. |
@klimov-paul TIL! Thanks for letting me know. I'll look into it. |
Fixes #32415
Re-use
Router::newRoute()
insideCompiledRouteCollection
, allow to use single place for the custom route definition.