mutateRequest(); } } function getJSONRequest() { return json_decode(file_get_contents('php://input'), true); } function mutateRequest() { if(Request::$contentType == "application/json") { Request::$data = $this->getJSONRequest(); } else { if(Request::$method == "post") { Request::$data = $_POST; } Request::$query = $_GET; }; } function contentType() { return Request::$contentType; } function method() { return Request::$method; } function get($name) { return Request::$query[$name] ?? null; } function has($name) { return $this->input($name) !== null; } function post($name) { return Request::$data[$name] ?? null; } function input($name) { return Request::staticGet($name) ?? Request::staticPost($name) ?? null; } function staticContentType() { return $this->contentType(); } function staticMethod() { return $this->method(); } function staticGet($name) { return $this->get($name); } function staticHeaders() { return Request::$headers; } function staticFile() { return Request::$file; } function staticSession() { return Request::$session; } function staticCookie() { return Request::$cookie; } function staticPost($name) { return $this->post($name); } function staticInput($name) { return $this->input($name); } function staticHas($name) { return $this->has($name); } function getAttribute($name) { return Request::staticInput($name); } };