routes['GET'][$path] = $handler; } public function post(string $path, callable $handler): void { $this->routes['POST'][$path] = $handler; } public function dispatch(string $method, string $path): void { $handler = $this->routes[$method][$path] ?? null; if ($handler === null) { Http::abort(404, 'The page you requested could not be found.'); } $handler(); } }