Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Improve Router.php namedRoutes caching #1738
pathFor() should function properly ( and not throw an exception) during the following sequence.
Therefore, getNamedRoute() should be more precise than is_null($this->namedRoutes). Comparing the size of namedRoutes to routes, while not perfect, is better.
That would be a better solution. Unfortunately, after thinking about this a little further, I'm not sure even that fully solves the problem.
It's absolutely possible to call
I think the simplest way to solve that would be to completely eliminate
Thanks @n0o0bSina , perhaps I should have been more clear. I wasn't suggesting that the named routes feature be removed. Rather, I'm now suggesting that
Sure, it's less performant, but that seems like a secondary concern to being correct. Does it make sense to just correct the error, and address any performance issues in another PR?
I've updated the pull request taking this conversation into consideration.