Skip to content

Commit

Permalink
Merge pull request #976 from abraham/url
Browse files Browse the repository at this point in the history
Switch apiUrl to protected
  • Loading branch information
abraham committed Jul 19, 2021
2 parents 7229769 + 06a1cb3 commit 51a502c
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions src/TwitterOAuth.php
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 51a502c

Please sign in to comment.