Skip to content
This repository was archived by the owner on Oct 13, 2022. It is now read-only.

Commit 75f3d2e

Browse files
committed
Hide Access to internal cURL functions
1 parent a9d762c commit 75f3d2e

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/UnionCloud/Api.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function setAuthToken($token, $token_expires) {
2929
#
3030
# Curl functions
3131
#
32-
public function _curl($endpoint, $verb) {
32+
private function _curl($endpoint, $verb) {
3333
$curl = new Curl();
3434
$curl->setUserAgent('UnionCloud API PHP Wrapper v' . $this->VERSION);
3535
$curl->setOpt(CURLOPT_SSL_VERIFYPEER, false);
@@ -53,7 +53,7 @@ public function _curl($endpoint, $verb) {
5353
return $curl;
5454
}
5555

56-
public function _curl_debug($curl, $echo_pre = false) {
56+
private function _curl_debug($curl, $echo_pre = false) {
5757
$debug_data = [
5858
"url" => $curl->getOpt(CURLOPT_URL),
5959
"request_headers" => iterator_to_array($curl->requestHeaders),
@@ -69,13 +69,13 @@ public function _curl_debug($curl, $echo_pre = false) {
6969
}
7070
}
7171

72-
public function _curl_exceptions($where) {
72+
private function _curl_exceptions($where) {
7373
if (array_key_exists("errors", $where)) {
7474
throw new Exception($where["errors"][0]["error_message"], str_replace("ERR", "", $where["errors"][0]["error_code"]));
7575
}
7676
}
7777

78-
public function _get($endpoint, $get_fields = null) {
78+
private function _get($endpoint, $get_fields = null) {
7979
$api_endpoint = $endpoint;
8080
if ($get_fields != null) {
8181
$api_endpoint .= "?" . http_build_query($get_fields);
@@ -86,7 +86,7 @@ public function _get($endpoint, $get_fields = null) {
8686
return $curl;
8787
}
8888

89-
public function _post($endpoint, $post_data, $get_fields = null) {
89+
private function _post($endpoint, $post_data, $get_fields = null) {
9090
$api_endpoint = $endpoint;
9191
if ($get_fields != null) {
9292
$api_endpoint .= "?" . http_build_query($get_fields);
@@ -98,14 +98,14 @@ public function _post($endpoint, $post_data, $get_fields = null) {
9898
return $curl;
9999
}
100100

101-
public function _put($endpoint, $data) {
101+
private function _put($endpoint, $data) {
102102
$curl = $this->_curl($endpoint, "PUT");
103103
$curl->setOpt(CURLOPT_POSTFIELDS, json_encode($data, JSON_UNESCAPED_SLASHES));
104104
$curl->exec();
105105
return $curl;
106106
}
107107

108-
public function _delete($endpoint, $data = null) {
108+
private function _delete($endpoint, $data = null) {
109109
$curl = $this->_curl($endpoint, "DELETE");
110110
$curl->exec();
111111
return $curl;

0 commit comments

Comments
 (0)