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