Skip to content

Commit

Permalink
Expose makeApiCall for APIs that don't yet have native support
Browse files Browse the repository at this point in the history
  • Loading branch information
Firehed committed Jul 22, 2024
1 parent f50b860 commit b53a604
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,14 @@ public function attachRegistration(string $regToken, array $user): Credential
}

/**
* @internal This method is made public for cases where APIs do not have
* native SDK support, but is NOT considered part of the public, stable
* API and is not subject to SemVer.
*
* @param mixed[] $params
* @return mixed[]
*/
private function makeApiCall(string $route, array $params): array
public function makeApiCall(string $route, array $params): array
{
// TODO: PSR-xx
$json = json_encode($params, JSON_THROW_ON_ERROR);
Expand All @@ -110,7 +114,6 @@ private function makeApiCall(string $route, array $params): array
CURLOPT_URL => sprintf('%s%s', $this->apiHost, $route),
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => $json,
// CURLOPT_VERBOSE => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Basic ' . base64_encode(':' . $this->secretKey),
Expand Down

0 comments on commit b53a604

Please sign in to comment.