methods[$method] = $controller; } } public function get($controller) { $this->methods["GET"] = $controller; return $this; } public function post($controller) { $this->methods["POST"] = $controller; return $this; } public function put($controller) { $this->methods["PUT"] = $controller; return $this; } public function delete($controller) { $this->methods["DELETE"] = $controller; return $this; } public function all($controller) { $this->methods["ALL"] = $controller; return $this; } public function getController(string $method) { return $this->methods[$method] ?? $this->methods["ALL"]; } }