urls = new ArrayUrlRegistry; $this->router = new HttpRouter(errorHandler: new RoutingErrorHandler); $this->router->use('/', fn($resp) => $resp->setPoweredBy('Misuzu')); } public function getUrls(): UrlRegistry { return $this->urls; } public function getRouter(): Router { return $this->router; } public function register(RouteHandler|UrlSource $handler): void { if($handler instanceof RouteHandler) $this->router->register($handler); if($handler instanceof UrlSource) $this->urls->register($handler); } public function dispatch(...$args): void { $this->router->dispatch(...$args); } }