mirror of
				https://github.com/sitelease/sugar-cube-client.git
				synced 2025-10-31 12:02: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]); | ||||
|     } | ||||
|  | ||||
|  | ||||
|     /** | ||||
|      * 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; | ||||
|  | ||||
		Reference in New Issue
	
	Block a user