src/TwitterIterator.php
public function checkRateLimits(array $response, array $original_arguments)
    {
        // Check for rate limits
        if (is_array($response) && isset($response['errors'], $response['tts'])) {
            if ($this->sleep_on_rate_limit) {
                if ($response['tts'] == 0) {
                    $this->api->debug('An error occured: ' . print_r($response['errors'], true));
                    $this->max_id = $this->since_id = 0;
                    return [];
                } else {
                    $this->api->debug("Sleeping for {$response['tts']}s. ...");
                    sleep($response['tts'] + 1);
                    // Retry
                    return $this->api->get($this->endpoint, $original_arguments);
                }
            } else {
                $this->max_id = $this->since_id = 0;
                return [];
            }
        }
        return $response;
    }
public function checkRateLimits(array $response, array $original_arguments)
    {
        // Check for rate limits
        if (is_array($response) && isset($response['errors'], $response['tts'])) {
            if ($this->sleep_on_rate_limit) {
                if ($response['tts'] == 0) {
                    $this->api->debug('An error occured: ' . print_r($response['errors'], true));
                    $this->max_id = $this->since_id = 0;
                    return [];
                } else {
                    $this->api->debug("Sleeping for {$response['tts']}s. ...");
                    sleep($response['tts'] + 1);
                    // Retry
                    return $this->api->get($this->endpoint, $original_arguments);
                }
            } else {
                $this->max_id = $this->since_id = 0;
                return [];
            }
        }
        return $response;
    }
public function checkRateLimits ( array $ response , array $ original_arguments ) { // Check for rate limits if ( is_array ( $ response ) && isset ( $ response [ 'errors' ] , $ response [ 'tts' ] ) ) { if ( $ this -> sleep_on_rate_limit ) { if ( $ response [ 'tts' ] == 0 ) { $ this -> api -> debug ( 'An error occured: ' . print_r ( $ response [ 'errors' ] , true ) ) ; $ this -> max_id = $ this -> since_id = 0 ; return [ ] ; } else { $ this -> api -> debug ( "Sleeping for {$response['tts']}s. ..." ) ; sleep ( $ response [ 'tts' ] + 1 ) ; // Retry return $ this -> api -> get ( $ this -> endpoint , $ original_arguments ) ; } } else { $ this -> max_id = $ this -> since_id = 0 ; return [ ] ; } } return $ response ; }
Check whether the response from Twitter's API is rate limiting the calls or not.

@param array $response Twitter's respose

@
Check whether the response from Twitter s API is rate limiting the calls or not .