mirror of
https://github.com/sitelease/sugar-cube-client.git
synced 2025-11-02 04:52:30 +01:00
Large changes to inter-object interfaces + More
+ Created a new core interface (called RequestChainable) and applied it to most of the objects using a trait + Altered the `__construct()` and `fromJson()` methods of all model classes by replacing the second parameter ($apiRequester) with a $caller parameter + Altered the `__construct()` method of all requester classes to make them accept $client by reference instead of by value + Altered the `__construct()` method of all requester classes by replacing the second parameter ($authToken) with a $caller parameter + Changed the name of several methods and properties + Altered several docblocks
This commit is contained in:
@ -18,7 +18,7 @@ class Organizations extends AbstractApiRequester
|
||||
*
|
||||
* Example:
|
||||
* ```
|
||||
* $giteaClient->organizations()->getByUsername($orgUsername);
|
||||
* $client->organizations()->getByUsername($orgUsername);
|
||||
* ```
|
||||
*
|
||||
* @param string $username
|
||||
@ -34,7 +34,7 @@ class Organizations extends AbstractApiRequester
|
||||
$statusCode = $response->getStatusCode();
|
||||
$body = $response->getBody();
|
||||
if ($statusCode == 200) {
|
||||
return Organization::fromJson(json_decode($body));
|
||||
return Organization::fromJson($client, $this, json_decode($body));
|
||||
} else {
|
||||
return $response;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user