function extractRatelimit(\Psr\Http\Message\ResponseInterface $response) {
        $date = (new \DateTime($response->getHeader('Date')[0]))->getTimestamp();
        
        $limit = ($response->hasHeader('X-RateLimit-Limit') ? ((int) $response->getHeader('X-RateLimit-Limit')[0]) : null);
        $remaining = ($response->hasHeader('X-RateLimit-Remaining') ? ((int) $response->getHeader('X-RateLimit-Remaining')[0]) : null);
        $resetTime = ($response->hasHeader('Retry-After')
            ? ((float) \bcadd(\microtime(true), (((int) $response->getHeader('Retry-After')[0]) / 1000)))
            : ($response->hasHeader('X-RateLimit-Reset') ? ((float) \bcadd(\microtime(true), (((int) $response->getHeader('X-RateLimit-Reset')[0]) - $date))) : null)
        );
        
        return \compact('limit', 'remaining', 'resetTime');
    }
function extractRatelimit(\Psr\Http\Message\ResponseInterface $response) {
        $date = (new \DateTime($response->getHeader('Date')[0]))->getTimestamp();
        
        $limit = ($response->hasHeader('X-RateLimit-Limit') ? ((int) $response->getHeader('X-RateLimit-Limit')[0]) : null);
        $remaining = ($response->hasHeader('X-RateLimit-Remaining') ? ((int) $response->getHeader('X-RateLimit-Remaining')[0]) : null);
        $resetTime = ($response->hasHeader('Retry-After')
            ? ((float) \bcadd(\microtime(true), (((int) $response->getHeader('Retry-After')[0]) / 1000)))
            : ($response->hasHeader('X-RateLimit-Reset') ? ((float) \bcadd(\microtime(true), (((int) $response->getHeader('X-RateLimit-Reset')[0]) - $date))) : null)
        );
        
        return \compact('limit', 'remaining', 'resetTime');
    }
function extractRatelimit ( \ Psr \ Http \ Message \ ResponseInterface $ response ) { $ date = ( new \ DateTime ( $ response -> getHeader ( 'Date' ) [ 0 ] ) ) -> getTimestamp ( ) ; $ limit = ( $ response -> hasHeader ( 'X-RateLimit-Limit' ) ? ( ( int ) $ response -> getHeader ( 'X-RateLimit-Limit' ) [ 0 ] ) : null ) ; $ remaining = ( $ response -> hasHeader ( 'X-RateLimit-Remaining' ) ? ( ( int ) $ response -> getHeader ( 'X-RateLimit-Remaining' ) [ 0 ] ) : null ) ; $ resetTime = ( $ response -> hasHeader ( 'Retry-After' ) ? ( ( float ) \ bcadd ( \ microtime ( true ) , ( ( ( int ) $ response -> getHeader ( 'Retry-After' ) [ 0 ] ) / 1000 ) ) ) : ( $ response -> hasHeader ( 'X-RateLimit-Reset' ) ? ( ( float ) \ bcadd ( \ microtime ( true ) , ( ( ( int ) $ response -> getHeader ( 'X-RateLimit-Reset' ) [ 0 ] ) - $ date ) ) ) : null ) ) ; return \ compact ( 'limit' , 'remaining' , 'resetTime' ) ; }
Extracts ratelimits from a response.
@param \Psr\Http\Message\ResponseInterface  $response
@return mixed[]
Extracts ratelimits from a response .