More discrete API for generating route objects.
dantleech opened this issue · 0 comments
dantleech commented
Currently you need to instantiate a UriContextCollection
in order to generate the auto routes.
$collection = new UriContextCollection($document);
$autoRouteManager->buildUriContextColleciton($collection);
foreach ($collection as $routeDocument) {
// ...
}
This is not a very clear interface, and I think we should encourage the explicit generation of auto routes in some situations rather than relying on Subscribers.
I propose to change the API to
$collection = $autoRouteManager->generate($document);
foreach ($collection as $routeDocument) {
// ...
}