add comments and style code

This commit is contained in:
Marc Michalsky forumZFD 2020-09-30 15:34:06 +02:00
parent 85afeedd23
commit c7eca6f641
Signed by untrusted user who does not match committer: marc.koch
GPG key ID: 12406554CFB028B9
2 changed files with 27 additions and 7 deletions

View file

@ -103,7 +103,14 @@ class TwingleApiCall {
}
/**
* @param $values
*
* Synchronizes projects between Twingle and CiviCRM (both directions)
* based on the timestamp.
*
* @param array $values
*
* If true: don't do any changes
* @param bool $is_test
*
* @return array|null
* @throws \CiviCRM_API3_Exception
@ -182,12 +189,12 @@ class TwingleApiCall {
private function curlPost($url, $data) {
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POST, TRUE);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"x-access-code: $this->apiKey",
'Content-Type: application/json',
]);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
$response = json_decode(curl_exec($curl), TRUE);
if (empty($response)) {
$response = curl_error($curl);
@ -196,4 +203,4 @@ class TwingleApiCall {
return $response;
}
}
}