i don't think you can chose whether to return a Route or a RouteCollection, can you? i think the DynamicRouter is expecting one or the other. i also don't like the "you should somehow" part. Maybe formulate it like this?: 

Here we inject the Doctrine Manager Registry into the RouteProvider service. As the RouteProvider is a Symfony service, you can inject whatever you need. The only important thing is that the provider returns a Route object resp. the RouteCollection for a Request.