File tree 1 file changed +10
-4
lines changed 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ class Client
89
89
/**
90
90
* @var string
91
91
*/
92
- private $ apiVersion = ' v3 ' ;
92
+ private $ apiVersion ;
93
93
94
94
/**
95
95
* The object that sends HTTP messages
@@ -141,8 +141,10 @@ class Client
141
141
* Instantiate a new GitHub client.
142
142
*
143
143
* @param HttpClient|null $httpClient
144
+ * @param string|null $apiVersion
145
+ * @param string|null $enterpriseUrl
144
146
*/
145
- public function __construct (HttpClient $ httpClient = null )
147
+ public function __construct (HttpClient $ httpClient = null , $ apiVersion = null , $ enterpriseUrl = null )
146
148
{
147
149
$ this ->httpClient = $ httpClient ?: HttpClientDiscovery::find ();
148
150
$ this ->messageFactory = MessageFactoryDiscovery::find ();
@@ -156,8 +158,12 @@ public function __construct(HttpClient $httpClient = null)
156
158
$ this ->addPlugin (new Plugin \HeaderDefaultsPlugin (array (
157
159
'User-Agent ' => 'php-github-api (http://github.com/KnpLabs/php-github-api) ' ,
158
160
)));
159
- // Add standard headers.
160
- $ this ->clearHeaders ();
161
+
162
+ $ this ->setApiVersion ($ apiVersion ?: 'v3 ' );
163
+
164
+ if ($ enterpriseUrl ) {
165
+ $ this ->setEnterpriseUrl ($ enterpriseUrl );
166
+ }
161
167
}
162
168
163
169
/**
You can’t perform that action at this time.
0 commit comments