mirror of
https://github.com/sitelease/sugar-cube-client.git
synced 2025-10-29 19:12:30 +01:00
Client - Added a static create() method
This commit is contained in:
@ -56,6 +56,23 @@ class Client {
|
|||||||
$this->guzzleClient = new GuzzleClient(['base_uri' => $giteaURL]);
|
$this->guzzleClient = new GuzzleClient(['base_uri' => $giteaURL]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a Gitea Client
|
||||||
|
*
|
||||||
|
* @param string $giteaURL
|
||||||
|
* @param string $authToken
|
||||||
|
*
|
||||||
|
* @return Client
|
||||||
|
*/
|
||||||
|
public static function create($giteaURL, $authToken = null)
|
||||||
|
{
|
||||||
|
$client = new self($giteaURL);
|
||||||
|
$client->setAuthToken($authToken);
|
||||||
|
|
||||||
|
return $client;
|
||||||
|
}
|
||||||
|
|
||||||
public function getGuzzleClient()
|
public function getGuzzleClient()
|
||||||
{
|
{
|
||||||
return $this->guzzleClient;
|
return $this->guzzleClient;
|
||||||
|
|||||||
Reference in New Issue
Block a user