/** * @param \Wispira\Framework\Http\MethodType|string $method */ public function setMethod($method) { if (!is_a($method, MethodType::class)) { $method = MethodType::getByName($method); } $this->method = $method; }
/** * @return \Wispira\Framework\Http\MethodType */ private function getRequestMethod() : MethodType { $method = null; if (array_key_exists("REQUEST_METHOD", $_SERVER)) { $method = $_SERVER["REQUEST_METHOD"]; } if (array_key_exists("_method", $_REQUEST) && !empty($_REQUEST["_method"])) { $method = $_REQUEST["_method"]; } $method = MethodType::getByName($method); return $method; }