/** * Send the appropriate URL request * * @param string $type * @param string $url * @param array $postParams * @param array $getParams * * @since 0.1.0 * * @return mixed */ private static function sendRequest($type, $url, $postParams, $getParams) { $getParams["api_key"] = self::$apiKey; $urlQuery = new UrlQuery($url, $getParams); switch ($type) { case "POST": return $urlQuery->sendPost($postParams); case "PUT": return $urlQuery->sendPut($postParams); case "DELETE": return $urlQuery->sendDelete(); default: throw new \InvalidArgumentException(); } }