-
-
Notifications
You must be signed in to change notification settings - Fork 598
Add rate limit endpoint #314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rate limit endpoint #314
Conversation
/** | ||
* Get rate limits | ||
* | ||
* @return \Guzzle\Http\EntityBodyInterface|mixed|string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks weird. The other methods tell me that this returns an array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, phpstrom thought for me on that one, will update to array.
Sorry for all the style fix commits... kept missing extra lines. |
👍 |
your new doc page needs to be linked from other doc page (probably the doc index in this case) |
@stof Good catch, i added the link to the readme. |
public function getCoreLimit() | ||
{ | ||
$response = $this->getRateLimits(); | ||
return $response['resources']['core']['limit']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please separate return statement with 1 blank line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use symfony
preset on your StyleCI config file or at least, add the return
fixer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #323.
@quickliketurtle very good, thank you! |
Hello,
I've added the rate_limit endpoint. With the default response, as well as 2 helpers for core rate limit and search rate limit.
I updated Client.php to allow both rateLimit and rate_limit options.
I've added a Test with the sample rate_limit response from github, as well as a functional test ( the functional group is excluded now, but you can run the single file manually and it passes ).
Also added a doc page.
Let me know if there are changed needed. I tried to follow style and naming convention by looking at existing code.
Thanks.