getParams(); if ($authenticationRequired) { $auth = new Authenticator(); if (!$auth->isAuthenticated($params)) { $this->authenticationMissing($params); return; } } $currentType = currentRequestType(); if($currentType === RequestType::GET) { $this->get($params); } else if ($currentType === RequestType::POST) { $this->post($params); } } private function getParams() { $content = json_decode(file_get_contents('php://input'), true); return new ParamCleaner(array_merge($content, $_REQUEST, $_SESSION, $_FILES)); } } ?>