urls = new URLRegistry; $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(): IRouter { return $this->router; } public function register(IRouteHandler|IURLSource $handler): void { if($handler instanceof IRouteHandler) $this->router->register($handler); if($handler instanceof IURLSource) $handler->registerURLs($this->urls); URLInfo::handleAttributes($this->urls, $handler); } public function dispatch(...$args): void { $this->router->dispatch(...$args); } }