We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d2d0fa6 commit d6ab64aCopy full SHA for d6ab64a
lib/Github/HttpClient/Message/ResponseMediator.php
@@ -56,9 +56,15 @@ public static function getPagination(ResponseInterface $response)
56
*/
57
public static function getApiLimit(ResponseInterface $response)
58
{
59
- $remainingCalls = self::getHeader($response, 'X-RateLimit-Remaining');
+ $remainingCallsHeader = self::getHeader($response, 'X-RateLimit-Remaining');
60
61
- if (null !== $remainingCalls && 1 > $remainingCalls) {
+ if (null === $remainingCallsHeader) {
62
+ return null;
63
+ }
64
+
65
+ $remainingCalls = (int) $remainingCallsHeader;
66
67
+ if (1 > $remainingCalls) {
68
throw new ApiLimitExceedException((int) $remainingCalls);
69
}
70
0 commit comments