Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Change route context attribute names #2889
PR for #2883
The attribute names are even configurable - although I am not sure if that should be an option. If not, let me know - I will remove all the unnecessary calls to static methods and instead hard code the attribute names.
If yes, maybe we could find another solution than using static methods and properties in the
Pass an optional
So we need
RouteContextFactoryInterface::createRouteContext():RouteContextInterface; RouteContext::attach(ServerRequestInterface, RouteContextInterface):ServerRequestInterface;
Then, whenever we need that route context, we can grab it from the
Warning: A lot of phpunit test cases would need rewrites.
I'm not familar with v4 yet so I wasn't sure if this attribute names where a public this, but apparently they are (#2892), so changing them is definitely a breaking change.
I'd rather see these names as configurable thing (with default names unchanged,
Your issue is unrelated to this. As I mentioned, pattern matching is done via FastRoute, which isn't code that was touched by this PR.
We do too however using the request attributes directly isn't the correct way to access the route/routing results/base path/etc. While it was originally stated that way in the earlier version of the v4 docs, this was a mistake and has since been changed. Using the