protected ?AutoRouterInterface
$autoRouter = null;
/**
* Stores a reference to the RouteCollection object.
*/
public function __construct(RouteCollectionInterface
$routes, ?Request
$request = null
) { $this->collection =
$routes;
// These are only for auto-routing
$this->controller =
$this->collection->
getDefaultController();
$this->method =
$this->collection->
getDefaultMethod();
$this->collection->
setHTTPVerb($request->
getMethod() ??
$_SERVER['REQUEST_METHOD'
]);
$this->translateURIDashes =
$this->collection->
shouldTranslateURIDashes();
if ($this->collection->
shouldAutoRoute()) { $autoRoutesImproved =
config(Feature::
class)->autoRoutesImproved ?? false;
if ($autoRoutesImproved) { $this->autoRouter =
new AutoRouterImproved( $this->collection->
getRegisteredControllers('*'
),
$this->collection->
getDefaultNamespace(),