From a6f2ee8c8aa800b46ed5a1eb8e42fdaf71f56dd7 Mon Sep 17 00:00:00 2001 From: Benjamin Blake Date: Tue, 25 Feb 2020 21:38:09 -0700 Subject: [PATCH] Client - Added a static `create()` method --- src/Client.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Client.php b/src/Client.php index 2d98887..879d55d 100644 --- a/src/Client.php +++ b/src/Client.php @@ -56,6 +56,23 @@ class Client { $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() { return $this->guzzleClient;