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:
Benjamin Blake
2020-02-26 20:23:06 -07:00
parent 57bf45938f
commit 70f978847e
21 changed files with 568 additions and 309 deletions

View File

@ -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;
}