Skip to content

Commit

Permalink
Switch apiUrl to protected
Browse files Browse the repository at this point in the history
  • Loading branch information
abraham committed Jul 19, 2021
1 parent 7229769 commit 06a1cb3
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions src/TwitterOAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -471,18 +471,37 @@ private function http(
) {
$this->resetLastResponse();
$this->resetAttemptsNumber();
$url = sprintf(
$this->response->setApiPath($path);
if (!$json) {
$parameters = $this->cleanUpParameters($parameters);
}
return $this->makeRequests(
$this->apiUrl($host, $path),
$method,
$parameters,
$json,
);
}

/**
* Generate API URL.
*
* Overriding this function is not supported and may cause unintended issues.
*
* @param string $host
* @param string $path
*
* @return string
*/
protected function apiUrl(string $host, string $path)
{
return sprintf(
'%s/%s/%s%s',
$host,
$this->apiVersion,
$path,
$this->extension(),
);
$this->response->setApiPath($path);
if (!$json) {
$parameters = $this->cleanUpParameters($parameters);
}
return $this->makeRequests($url, $method, $parameters, $json);
}

/**
Expand Down

0 comments on commit 06a1cb3

Please sign in to comment.