Split off from my T405373 comment:
In T405373#11399312, @aaron wrote:It would also be nice to get Router out of Module:
- Injecting RouteLocator, and having a getRouteLocator() method, could replace the $this->getRouter()->getRouteUrl() calls.
- The $this->router->isRestbaseCompatEnabled() calls could be replace by calls to the static RestbaseCompat::isRestbaseCompatEnabled helper method.
- The $this->router->getRestbaseCompatErrorData() calls could be replaced by calls to a static RestbaseCompat::getRestbaseCompatErrorData helper method (taking the responseFactory as an additional argument).
- The $this->getRouter()->prepareHandler() calls could just inline the body of prepareHandler().