You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Everything stems from the `NewTwitchApi` class. However, if you want to individually instantiate `UsersApi`, `OauthApi`, etc. you are free to do so.
127
+
Everything stems from the `TwitchApi` class. However, if you want to individually instantiate `UsersApi`, `OauthApi`, etc. you are free to do so.
128
128
129
129
The API calls generally return an object implementing `ResponseInterface`. Since you are getting the full `Response` object, you'll need to handle its contents, e.g. by decoding then into an object with `json_decode()`. This library does not assume this is what you want to do, so it does not do this for you automatically. This library simply acts as a middleman between your code and Twitch, providing you with the raw responses the Twitch API returns.
130
130
131
-
The individual API classes that can be called from `NewTwitchApi` correspond to the [Twitch API documentation](https://dev.twitch.tv/docs/api/). The rest of the API classes are based on the resources listed [here](https://dev.twitch.tv/docs/api/reference/). The methods in the classes generally correspond to the endpoints for each resource. The naming convention was chosen to try and match the Twitch documentation. Each primary endpoint method (not convenience or helper methods) should have an `@link` annotation with a URL to that endpoint's specific documentation.
131
+
The individual API classes that can be called from `TwitchApi` correspond to the [Twitch API documentation](https://dev.twitch.tv/docs/api/). The rest of the API classes are based on the resources listed [here](https://dev.twitch.tv/docs/api/reference/). The methods in the classes generally correspond to the endpoints for each resource. The naming convention was chosen to try and match the Twitch documentation. Each primary endpoint method (not convenience or helper methods) should have an `@link` annotation with a URL to that endpoint's specific documentation.
132
132
133
133
Here is a sample of retrieving a users table from their access token:
134
134
@@ -140,14 +140,14 @@ $twitch_access_token = 'the token';
140
140
141
141
// The Guzzle client used can be the included `HelixGuzzleClient` class, for convenience.
142
142
// You can also use a mock, fake, or other double for testing, of course.
143
-
$helixGuzzleClient = new \NewTwitchApi\HelixGuzzleClient($twitch_client_id);
143
+
$helixGuzzleClient = new \TwitchApi\HelixGuzzleClient($twitch_client_id);
144
144
145
-
// Instantiate NewTwitchApi. Can be done in a service layer and injected as well.
146
-
$newTwitchApi = new NewTwitchApi($helixGuzzleClient, $twitch_client_id, $twitch_client_secret);
145
+
// Instantiate TwitchApi. Can be done in a service layer and injected as well.
146
+
$twitchApi = new TwitchApi($helixGuzzleClient, $twitch_client_id, $twitch_client_secret);
147
147
148
148
try {
149
149
// Make the API call. A ResponseInterface object is returned.
0 commit comments