Skip to content

Commit cf5d58e

Browse files
committed
Removed setter for ApiVersion and EnterpriceUrl
1 parent 8f0f834 commit cf5d58e

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

lib/Github/Client.php

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ public function __construct(HttpClient $httpClient = null, $apiVersion = null, $
159159
'User-Agent' => 'php-github-api (http://github.com/KnpLabs/php-github-api)',
160160
)));
161161

162-
$this->setApiVersion($apiVersion ?: 'v3');
162+
$this->apiVersion = $apiVersion ?: 'v3';
163+
$this->addHeaders(['Accept' => sprintf('application/vnd.github.%s+json', $this->apiVersion)]);
163164

164165
if ($enterpriseUrl) {
165166
$this->setEnterpriseUrl($enterpriseUrl);
@@ -305,7 +306,7 @@ public function authenticate($tokenOrLogin, $password = null, $authMethod = null
305306
*
306307
* @param string $enterpriseUrl URL of the API in the form of http(s)://hostname
307308
*/
308-
public function setEnterpriseUrl($enterpriseUrl)
309+
private function setEnterpriseUrl($enterpriseUrl)
309310
{
310311
$this->removePlugin(Plugin\AddHostPlugin::class);
311312
$this->removePlugin(PathPrepend::class);
@@ -375,21 +376,6 @@ public function getApiVersion()
375376
return $this->apiVersion;
376377
}
377378

378-
/**
379-
* @param string $apiVersion
380-
*
381-
* @return Client
382-
*/
383-
public function setApiVersion($apiVersion)
384-
{
385-
$this->apiVersion = $apiVersion;
386-
$this->addHeaders([
387-
'Accept' => sprintf('application/vnd.github.%s+json', $apiVersion),
388-
]);
389-
390-
return $this;
391-
}
392-
393379
/**
394380
* Clears used headers.
395381
*/

0 commit comments

Comments
 (0)